%SSC_INIT

Initialize a database channel

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
value = %SSC_INIT(dbchannel, [maxcur], [maxcol], [bufsize][, dbcursor])

Return value

value

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

Arguments

dbchannel

An internal database channel to be used for a connection. The range is 1 to 100 (Windows) and 1 to 7 (UNIX and OpenVMS). (n)

maxcur

(optional) The number of logical cursors to allocate for the channel. The default is 128. (n)

maxcol

(optional) The maximum number of columns that can be returned from a query. The default is 254. (n)

bufsize

(optional) The internal buffer size (in bytes) used for prefetch caching. The default is 32768. (n)

dbcursor

(optional) The number of database cursors to allocate for the channel. The default is maxcur. (n)

Discussion

%SSC_INIT must be the first function call when using SQL Connection, except

%SSC_INIT initializes an SQL Connection session, establishes an internal structure containing information used by %SSC_CONNECT and other routines, and provides a method for defining communication with the low‑level structures. The internal structure is accessed by dbchannel, which is analogous to a channel established in a Synergy DBL OPEN statement. See Database connections for more information, and note the following:

Examples

The following is an example of SQL channel initialization using database channel 1 and setting 32 concurrent cursors, 100 maximum columns, and a 5000‑byte prefetch buffer size.

dbchn = 1          ;Use database channel 1
if (%ssc_init(dbchn, 32, 100, 5000))
  goto err_exit    ;Initializes connection to use 32 concurrent cursors, 
                   ; 100 maximum columns, and 5000-byte prefetch buffer
if (%ssc_connect(dbchn, user))
  goto err_exit