The CONNECT session management statement begins an SQL session by connecting to a CA IDMS dictionary. The dictionary you specify must contain the definitions of the database to be accessed during the session.
To issue a CONNECT statement:
►►─── CONNECT TO ─┬─ dictionary-name ──────────────┬──────────────────────────►◄ ├─ :dictionary-variable-name ────┤ └─ dictionary-sqlvariable-name ──┘
Specifies the name of the dictionary to which the session is connected.
Identifies a host variable containing the name of the dictionary to which the session is connected. Dictionary-variable-name must be a host variable previously declared in the application program.
Identifies a routine parameter or local variable containing the name of the dictionary to which the session will be connected. Dictionary-sqlvariable-name must be previously declared in the SQL routine.
You can specify :dictionary-variable-name or dictionary-sqlvariable-name only when you embed the CONNECT statement in an application program or SQL routine.
Ending an SQL Session
If you use the CONNECT statement to begin an SQL session, you must end the session with one of the following statements:
Automatic Connection
The CONNECT statement is not required to establish a connection. CA IDMS automatically attempts to establish a connection upon executing the first SQL statement. When establishing an automatic connection, CA IDMS establishes a connection to a default dictionary.
Specifying a Dictionary Name
The name specified on a CONNECT statement should be associated with a DDLDML area, a DDLCAT area; or a DDLDML and a DDLCAT area. The name can represent:
If you specify a DBNAME, it can include segments in addition to those for the dictionary itself.
Specifying the Dictionary Name
The following CONNECT statement establishes a connection to the dictionary named EMPDICT.
connect to empdict;
Using a Host Variable
The following CONNECT statement establishes a connection to the dictionary name contained in the host variable :DICT-NAME:
EXEC SQL CONNECT TO :DICT-NAME END-EXEC
|
Copyright © 2014 CA.
All rights reserved.
|
|