%SSC_BIND

Bind host variables for non‑SELECT statement

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
value = %SSC_BIND(dbchannel, dbcursor, numvars, var[, ...])

Return value

value

This function returns SSQL_NORMAL (success) or SSQL_FAILURE (failure). (i)

Arguments

dbchannel

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

dbcursor

The logical cursor number within the range from 1 through the maximum number specified by maxcur during %SSC_INIT. The cursor must have been opened by %SSC_OPEN. (n)

numvars

The number of bind variables in the non‑SELECT statement, up to the maximum number of columns specified by the maxcol argument in %SSC_INIT. If numvars is negative, the bind variables are overwritten rather than appended. If numvars is positive, the bind variables are appended to the variables for the non‑SELECT statement. (n)

var

Host variable(s) to be bound to the non‑SELECT statement. The number of var variables passed must equal the value of numvars. (a, n, or String)

Discussion

%SSC_BIND binds host variables to variables for a non‑SELECT statement. It affects only variables that are used when %SSC_EXECUTE is called. See Binding data for more information on binding, and note the following:

Examples

The following example shows how to bind two Synergy DBL variables associated with cur1.

record order_rec
       ord_num            ,d6
       ord_cust           ,d6
.
.
.
sqlp = "UPDATE orders SET or_number = :1 WHERE or_customer = :2
if (%ssc_open(dbchn, cur1, sqlp, SSQL_NONSEL))
  goto err_exit
if (%ssc_bind(dbchn, cur1, 2, ord_num, ord_cust))
  goto err_exit
if (%ssc_execute(dbchn, cur1, 1))
  goto err_exit