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:sqlEscapeHDS
Description:The active:sqlEscapeHDS service accepts an HDS representation and returns a new HDS representation with any String object values converted using "escape" substitutions.
Id:mod-db:sqlEscapeHDS
Category:accessor
Identifier Syntax

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

Base
active:sqlEscapeHDS

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

ArgumentRulesTypingDescription
operand
Mandatory
Representation (java.lang.Object)HDS structure 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 sqlEscapeHDS 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:sqlEscapeHDS the HDS structure specified in the required operand argument is examined and if any nodes are found of the class String then they are "escaped". The returned representation is always a new HDS structure even if there are no nodes with String objects.

For example, the HDS structure:

<customer>
  <name>Fred's bakery</name>
</customer>

will be converted to a new HDS structure:

<customer>
  <name>Fred''s bakery</name>
</customer>

Example

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

hdsToEscape = context.source("arg:operand", IHDSNode.class);
request = context.createRequest("active:sqlEscapeHDS")
request.addArgumentByValue("operand", hdsToEscape)
escapedHDS = context.issueRequest(request)