Programming Guide |
Uses a named connection for the duration of a statement
DBMS WITH CONNECTIONconnection
DBMSstatement
...
WITH CONNECTION
connection
- 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 CONNECTION
clause is in aDECLARE CURSOR
statement.
DBMS WITH CONNECTIONconnection
DECLAREcursor
CURSOR...Once a cursor is declared it remains associated with the connection on which it was declared. After declaring the cursor, the
DBMS WITH CONNECTION
clause must not be used in statements that manipulate the cursor. However, theDBMS WITH CONNECTION
clause can be used on statements that manipulate the default cursor on any declared connection. Therefore, the following commandsDBMS WITH CONNECTIONconnection
ALIAS ...
DBMS WITH CONNECTIONconnection
CATQUERY ...
DBMS WITH CONNECTIONconnection
CLOSE CURSOR
DBMS WITH CONNECTIONconnection
COLUMN_NAMES
DBMS WITH CONNECTIONconnection
CONTINUE
DBMS WITH CONNECTIONconnection
CONTINUE_BOTTOM
DBMS WITH CONNECTIONconnection
CONTINUE_TOP
DBMS WITH CONNECTIONconnection
CONTINUE_UP
DBMS WITH CONNECTIONconnection
FORMAT ...
DBMS WITH CONNECTIONconnection
OCCUR ...
DBMS WITH CONNECTIONconnection
QUERY ...
DBMS WITH CONNECTIONconnection
RUN ...
DBMS WITH CONNECTIONconnection
SQL ...
DBMS WITH CONNECTIONconnection
START ...
DBMS WITH CONNECTIONconnection
STORE ...
DBMS WITH CONNECTIONconnection
UNIQUE ...perform the request on the default
SELECT
cursor on the named connection.Some engine-specific DBMS commands can also support the
WITH CONNECTION
clause. 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