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][, cursors])


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


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)


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


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


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


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

%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 Making database connections for more information, and note the following:

The following is an example of SQL channel initialization using database channel 1 and setting 32 concurrent database and statement 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