%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, dbcursor[, ...])

Return value

value

This function returns SSQL_NORMAL (success). (i)

Arguments

dbchannel

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

dbcursor

One or more logical cursor numbers within the range from 1 through the maximum number specified by maxcur during %SSC_INIT. These cursors must have been opened by %SSC_OPEN. (n)

Discussion

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

Examples

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