%SSC_SCLOSE

Soft close one or more open cursors

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

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(s) of one or more open cursors (opened with %SSC_OPEN). Cursor must be in the range 1 through the number specified by maxcur when the database channel was initialized (with %SSC_INIT). (n)

%SSC_SCLOSE soft closes one or more cursors opened in %SSC_OPEN. A soft close enables SQL Connection to reuse an associated database cursor. For information on closing and reusing cursors, see Closing cursors and Reusing cursors. Note the following:

The following code segment shows re-use of a soft closed cursor (the SELECT statement isn’t re-parsed).

sqlp = "SELECT name, id, type FROM objects "
  &      " WHERE name = :1 AND type = :2"
do forever
          begin
    call get_name_and_type        ;Set the search name and type
    if (sts = %ssc_open(dbchn, cur1, sqlp, SSQL_SELECT,
  &                     SSQL_STANDARD, 2, spec, stype))
      goto err_exit
    if (%ssc_define(dbchn, cur1, 3, name, id, type))
      goto err_exit
    sts = %ssc_move(dbchn, cur1, 1)
    if (sts.eq.SSQL_NOMORE) then
      exitloop
    else if (sts.eq.SSQL_FAILURE)
      goto err_exit
    call do_processing
    if (sts = %ssc_slose(dbchn, cur1))
      goto err_exit
  end