![]() | Programming Guide | ![]() |
Uses a named connection for the duration of a statement
DBMS WITH CONNECTIONconnectionDBMSstatement...
WITH CONNECTIONconnection- Specifies connection for the execution of the command, overriding the default connection. connection must be declared and open. Colon expansion on the connection name is allowed.
DBMSstatement- Text of the DBMS command.
The most frequent use of the
DBMS WITH CONNECTIONclause is in aDECLARE CURSORstatement.DBMS WITH CONNECTIONconnectionDECLAREcursorCURSOR...Once a cursor is declared it remains associated with the connection on which it was declared. After declaring the cursor, the
DBMS WITH CONNECTIONclause must not be used in statements that manipulate the cursor. However, theDBMS WITH CONNECTIONclause can be used on statements that manipulate the default cursor on any declared connection. Therefore, the following commandsDBMS WITH CONNECTIONconnectionALIAS ...
DBMS WITH CONNECTIONconnectionCATQUERY ...
DBMS WITH CONNECTIONconnectionCLOSE CURSOR
DBMS WITH CONNECTIONconnectionCOLUMN_NAMES
DBMS WITH CONNECTIONconnectionCONTINUE
DBMS WITH CONNECTIONconnectionCONTINUE_BOTTOM
DBMS WITH CONNECTIONconnectionCONTINUE_TOP
DBMS WITH CONNECTIONconnectionCONTINUE_UP
DBMS WITH CONNECTIONconnectionFORMAT ...
DBMS WITH CONNECTIONconnectionOCCUR ...
DBMS WITH CONNECTIONconnectionQUERY ...
DBMS WITH CONNECTIONconnectionRUN ...
DBMS WITH CONNECTIONconnectionSQL ...
DBMS WITH CONNECTIONconnectionSTART ...
DBMS WITH CONNECTIONconnectionSTORE ...
DBMS WITH CONNECTIONconnectionUNIQUE ...perform the request on the default
SELECTcursor on the named connection.Some engine-specific DBMS commands can also support the
WITH CONNECTIONclause. For more information, refer to "Database Drivers."
// This procedure performs a commit before closing the
// connection.proc cleanup (connection)
DBMS WITH CONNECTION :connection COMMIT
DBMS CLOSE CONNECTION :connection
return 0
DECLARE CONNECTION,dm_is_connection
![]()
![]()
![]()
![]()