%SSC_BIND

Bind host variables for non-SELECT statement

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

value

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

dbchannel

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

stcursor

The ID number of an open statement cursor (opened with %SSC_OPEN). This must be in the range 1 through the number specified by maxcur when the database channel was initialized (with %SSC_INIT). (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 parameter. The number of var variables passed must equal the value of numvars. (a, n, or String)

%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:

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