RDB/VMS SQL CONNECT — VMS RDB_4.1_M
CONNECT ──┐ ┌─────────┘ └─┬───────────────────────────────────────┬──┐ └─>
T
O ──┬─> connect-string-literal ────┤ │ ├─> connect-parameter ─────────┤ │ └─> connect-parameter-marker ──┘ │ ┌────────────────────────────────────────────┘ └─┬───────────────────────────────────────┬──┐ └─>
A
S ─┬────────────────────┬─────────┬┘ │ ├─> connection-name ─┘ │ │ ├─> connect-parameter ─────────┤ │ └─> connect-parameter-marker ──┘ │ ┌────────────────────────────────────────────┘ └┬───────────────────────────────────────────────┬─> typebox (;) └┬─┬─>
C
A
T
A
L
O
G ┬─> catalog-name ─────────────┬─┬┘ │ │ ├─> catalog-parameter ────────┤ │ │ │ └─> catalog-parameter-marker ─┤ │ │ └─>
S
C
H
E
M
A ─┬─> schema-name ──────────────┤ │ │ ├─> schema-parameter ─────────┤ │ │ └─> schema-parameter-marker ──┘ │ └─────────────── , <──────────────────────────┘
Additional information available:
connect expressionMore Information
connect expression
connect-expression =
───┬──>
D
E
F
A
U
L
T ────────────────────┬─>
└┬─> db-specification ───────┬───┘
└──────── , <───────────────┘
Additional information available:
More Information
The connect expression is a character string literal that specifies the database environment for the connection. You can specify the alias of any database declared using the DECLARE ALIAS statement in all modules of the application or the alias of any database attached using an ATTACH statement.
More Information
The CONNECT statement associates an SQL environment with a connection and specifies a connection name for the association. An SQL environment is one or more databases that can be attached or detached as a unit. When you execute a procedure, the databases that you specify in DECLARE ALIAS or ATTACH statements are the SQL environment for that procedure. You can use the CONNECT statement to add another database to the current SQL environment or to substitute a different group of databases for the default SQL environment. You can issue two different CONNECT statements that attach to the same database, but each attach is unique. Each CONNECT statement creates its own implicit transaction. You can use the connection name to specify a global database context when writing SQL modules for concurrent access to one or more databases. Once you have specified a connection name in a CONNECT statement, you can refer to that name in subsequent SET CONNECT statements. You can use a SET CONNECT statement to specify a new environment for a procedure to run against without having to detach and recompile queries.