%SSC_INDICATOR

Retrieve indicator variables

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
value = %SSC_INDICATOR(dbchannel, cursor, int_array, [ncount][, vars])

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 (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)

int_array

A real array whose elements will be filled with SQL indicator variables. (n)

ncount

(optional) The row of a multirow operation whose status you want returned. Default is 1. (n)

vars

(optional) The number of vars moved, up to a maximum of int_array elements. (a or n)

The value for each element in int_array relays the status of either the defined variables in the output order specified by %SSC_DEFINE or %SSC_STRDEF, or the defined variables in the output and in/out order specified by %SSC_EXECIO.

Possible returned values for each element in int_array:

– 1 = The column is null (or no data was moved in the last statement).

0 = The column was moved successfully.

> 0 = The data was truncated, and the non-truncated size is reported.

The following is an example of retrieving the status of two SELECT columns, deptnum and deptname. In particular, this example reports the status of moving deptnum into the host variable and whether deptname was returned as a null or the data was truncated.

sqlp = "SELECT deptnum, deptname FROM org WHERE deptnum = 1"
if (ssc_open(dbchn, cur2, sqlp, SSQL_SELECT, SSQL_STANDARD))
  goto error_exit
if (ssc_define(dbchn, cur2, 2, deptnum, deptname))
  goto error_exit
if (ssc_move(dbchn, cur2, 1))
  goto error_exit
if (ssc_indicator(dbchn, cur2, intarray))
  goto error_exit
writes(15, "status of deptnum is"+%string(intarray[1]))
writes(15, "status of deptname is"+%string(intarray[2]))