Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
value = %SSC_MOVE(dbchannel, dbcursor, [ncount], [row_count], [compute_flg][, warn])
This function returns SSQL_NORMAL (success), SSQL_FAILURE (failure), or SSQL_NOMORE (no more data found for current result set). (i)
An internal database channel previously initialized using %SSC_INIT and connected by %SSC_CONNECT. (n)
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)
(optional) The number of rows to fetch. This argument defaults to 1 for databases that do not support multirow fetch. (n)
(optional) Returned number of rows actually fetched by the SQL statement associated with dbcursor. This count is valid only when value is returned as SSQL_NORMAL. (n)
This argument is no longer supported.
(optional) A variable that is set to 1 if one or more rows return a warning status (such as “data columns truncated”). (n)
%SSC_MOVE fetches one or more rows of data into host variables defined by %SSC_DEFINE or %SSC_STRDEF. For multirow fetches, %SSC_MOVE returns SSQL_NOMORE if not all requested rows are fetched. (If you request a four‑row fetch, for example, but %SSC_MOVE is able to fetch only three rows, %SSC_MOVE returns SSQL_NOMORE.) You can use row_count to find out how many rows were actually fetched.
Note the following:
The following example shows how to move column data to a Synergy DBL data area.
sqlp = "SELECT deptnum, deptname" & " FROM org WHERE deptnum = :1" sts=%ssc_open(dbchn, cur2, sqlp, SSQL_SELECT, SSQL_STANDARD, 1, deptnum) sts=%ssc_define(dbchn, cur2, 2, deptnum, deptname) ; Get dnum to SELECT rows display(g_terminal, "Enter Department Number: ") reads(g_terminal, %a(dnum)) ; Do fetch and display rows to screen one row at a time do forever begin sts = %ssc_move(dbchn, cur2, 1) if (sts.eq.SSQL_FAILURE) then ;ERROR goto err_exit else if (sts.eq.SSQL_NOMORE) ;EOF exitloop writes(g_terminal, %string(deptnum) + ", " + deptname)
For an example of a single row fetch, see exam_fetch.dbl. For an example of a multirow fetch, see exam_multirow_fetch.dbl. These example files are in the connect\synsqlx subdirectory of the main Synergy/DE installation directory.