|
|
BSQL and Multiple Connections
After logging in using BSQL, additional connections can be established using the
CONNECTstatement, which has the following form:CONNECT TO 'database' [AS 'connection_name'] USER 'username' USING 'password';This statement establishes a new connection between the user and a database, see the Mimer SQL Reference Manual, CONNECTfor details.
The database may be given an explicit connection name for use in
DISCONNECTandSET CONNECTIONstatements. If no explicit connection name is specified, the database name is used as the connection name.Changing Connections
BSQL may make multiple connections to the same or different databases using the same or different idents, provided that each connection is identified by a unique connection name. In this situation only one connection is active and the other connections are inactive. A connection established by a successful
CONNECTstatement is automatically active.A connection may be made active by the
SET CONNECTIONstatement.SET CONNECTION 'connection_name';Disconnecting
The
DISCONNECTstatement breaks the connection between the user and a database. The connection to be broken is specified as the connection name or as one of the keywordsALL,CURRENTorDEFAULT.DISCONNECT 'connection_name';A connection does not have to be active in order to be disconnected. If an inactive connection is broken, BSQL still has uninterrupted access to the database through the current (active) connection, but the broken connection is no longer available for activation with
SET CONNECTION.If the active connection is broken, BSQL cannot access any database until a new
CONNECTorSET CONNECTIONstatement is issued.Note: The distinction between breaking a connection with DISCONNECT and making a connection inactive by issuing a CONNECT or SET CONNECTION for a different connection is, a broken connection has no saved resources and cannot be reactivated by SET CONNECTION.
The table below summarizes the effect on the connection
con1ofCONNECT,DISCONNECTandSET CONNECTIONstatements depending on the state of the connection.
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|