CONNECT
SQL statement
Description
Connects to a specified database.
Syntax
|
1 |
CONNECT {USING TransactionObject}; |
|
Parameter |
Description |
|---|---|
|
TransactionObject |
The name of the transaction object containing the |
Usage
This statement must be executed before any actions (such as
INSERT, UPDATE, or DELETE) can be processed using the default
transaction object or the specified transaction object.
Error handling
It is good practice to test the success/failure code after
executing a CONNECT statement.
Examples
Example 1
This statement connects to the database specified in the default
transaction object:
|
1 |
CONNECT ; |
Example 2
This statement connects to the database specified in the
transaction object named Emp_tran:
|
1 |
CONNECT USING Emp_tran ; |