%SSC_SQLLINK

Link a non-SELECT statement to cursor for a SELECT statement

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
value = %SSC_SQLLINK(dbchannel, cursor, statement[, numvars][, var, ...])

value

This function returns SSQL_NORMAL (success). (i)

dbchannel

An internal database channel previously initialized using %SSC_INIT and connected by %SSC_CONNECT. (n)

cursor

The ID number of an open cursor that will be linked to statement (a non-SELECT statement). Cursor must be within the range from 1 through the maximum number specified by the maxcur argument for %SSC_INIT. The cursor must have been opened by %SSC_OPEN. (n)

statement

The SQL statement. (a)

numvars

(optional) The number of bound host variables that follow. Note that numvars cannot exceed the value of maxcol passed in the %SSC_INIT call. (n)

var

(optional) Host variables to be bound to the non-SELECT statement. If numvars is passed, the number of var arguments passed must equal the value of numvars. (n)

%SSC_SQLLINK links a new non-SELECT statement (statement) to an already opened SELECT statement cursor (cursor), clears all defined variables and bound variables, and rebinds variables for the new non-SELECT statement to follow. The primary use of %SSC_SQLLINK is to update the current row just fetched through %SSC_MOVE (with the SSQL_POSITION and SSQL_FORUPDATE options set in the %SSC_OPEN for the database cursor).

Note the following:

For more information on binding host variables, see Binding data.

For an example, see exam_fetch_update.dbl, which is in the connect\synsqlx subdirectory of the main Synergy/DE installation directory.