Was this helpful?
SET_SQL
Valid in: ESQL
The SET_SQL statement specifies runtime options for the current session.
The SET_SQL statement can switch sessions in a multiple session application, specify the type of DBMS error to be returned to an application, change the default behavior when a connection error is experienced, set trace functions, and set other session characteristics.
SET_SQL can be used to override II_EMBED_SET. For more information about II_EMBED_SET, see the Ingres System Administrator Guide.
The SET_SQL statement has the following format:
EXEC SQL SET_SQL (object = value {, object = value})
The valid objects and values for the SET_SQL statement are as follows:
Object
Data Type
Description
dbeventdisplay
integer
Enables or disables the display of events as they are queued to an application. Specify 1 to enable display, 0 to disable display.
dbeventhandler
function pointer
Specifies a user-defined routine to be called when an event notification is queued to an application. The event handler must be specified as a function pointer.
dbmserror
integer
Sets the value returned by the inquire_sql(dbmserror) statement. For details about the values returned by the inquire_sql(dbmserror) statement, see Local and Generic Errors on page 142.
errorhandler
function pointer
Specifies a user‑defined routine to be called when an OpenSQL error occurs in an embedded application. The error handler must be specified as a function pointer.
errorno
integer
Sets the value returned by the inquire_sql(errorno) statement. For details about the values returned by the inquire_sql(errorno) statement, see Local and Generic Errors on page 142.
errortype
character string
Specifies the type of error number returned to errorno and sqlcode. Value can be either genericerror, specifying generic error numbers, or dbmserror, specifying local DBMS error numbers. Generic error numbers are returned by default. For information about local and generic errors, see Local and Generic Errors on page 142.
gcafile
character string
Specifies an alternate text file to which OpenSQL writes GCA information. The default file name is “iiprtgca.log”. To enable this feature, use the set_sql printgca option.
If a directory or path specification is omitted, the file is created in the current default directory.
printgca
integer
Turns the printgca debugging feature on or off. Printgca prints all communications (GCA) messages from the application as it executes (by default, to the file “iiprtgca.log” in the current directory). Value can be either 1, to turn the feature on, or 0, to turn the feature off.
printqry
integer
Turns the printqry debugging feature on or off. Printqry prints all query text and timing information from the application as it executes (by default to the file “iiprtqry.log” in the current directory). Value can be either 1, to turn the feature on, or 0, to turn the feature off.
printtrace
integer
Enable/disable trapping of DBMS trace messages to a text file (by default, “iiprttrc.log”). Specify 1 to enable trapping of trace output, 0 to disable trapping.
programquit
integer
Specifies whether OpenSQL aborts on one of the following errors:
An application issues a query, but is not connected to a database.
The Enterprise Access product or DBMS fails.
Communications services fail.
Specify 1 to abort on these conditions, 0 to continue.
qryfile
character string
Specifies an alternate text file to which OpenSQL writes query information. The default file name is “iiprtqry.log”. To enable this feature, use the set_sql printqry option.
If a directory or path specification is omitted, the file is created in the current default directory.
savequery
integer
Enables/disables saving of the text of the last query issued. Specify 1 to enable, 0 to disable. To obtain the text of the last query, issue the inquire_sql(querytext) statement. To determine whether saving is enabled, use the inquire_sql(savequery) statement.
session
integer
Sets the current session. Value can be any session identifier associated with an open session in the application.
tracefile
character string
Specifies an alternate text file to which OpenSQL writes tracepoint information. The default file name is “iiprttrc.log”. To enable this feature, use the set_sql printtrace option.
If a directory or path specification is omitted, the file is created in the current default directory.
Last modified date: 04/03/2024