8. OpenSQL Statements : CONNECT : Examples: Connect
 
Share this page                  
Examples: Connect
The following are examples of CONNECT:
1. Connect to the DB2UDB database mydb on virtual node UNIXBOX.
exec sql connect 'unixbox::master/db2'
with db2udb = 'audit all';
2. Connect to two databases: the Ingres database named personnel, which is located in London, and the local Rdb/VMS database called sales. Set the current session to the personnel database.
exec sql connect 'london::personnel' session 1;
exec sql connect 'sales/rdb' session 2;
exec sql set_sql (session = 1);