WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:sqlEscapeString
Description:The active:sqlEscapeString service accepts a String representation and returns a version of the representation with several character "escape" substitutions.
Id:mod-db:sqlEscapeString
Category:accessor
Identifier Syntax

sqlEscapeString is an accessor using Active URI syntax with the following base identifiers:

Base
active:sqlEscapeString

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
operand
Mandatory
Representation (java.lang.Object)String to which escape substitutions are applied
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

Import Requirements

To use sqlEscapeString accessor you must import the module urn:org:netkernel:mod:db:

<import>
  <uri>urn:org:netkernel:mod:db</uri>
</import>

When a request with the SOURCE verb is issued to active:sqlEscapeString the String specified in the required operand argument is examined and if any characters are found which must be "escaped" prior to sending to a database are replaced and the returned representation contains the full "escaped" text string value.

For example, this string:

This string's values must be 'escaped'

when is escaped to:

This string''s values must be ''escaped''

Example

The following code performs the SQL escaping of a passed argument value.

stringToEscape = context.source("arg:operand", String.class);
request = context.createRequest("active:sqlEscapeString")
request.addArgumentByValue("operand", stringToEscape)
escapedString = context.issueRequest(request)