HP 3000 Manuals

CONNECT [ ALLBASE/SQL Reference Manual ] MPE/iX 5.5 Documentation


ALLBASE/SQL Reference Manual

CONNECT 

The CONNECT statement initiates a connection with a given DBEnvironment.
This connection is the current connection.  Any SQL statements issued
apply to the current connection.

Scope 

ISQL or Application Programs

SQL Syntax 

CONNECT TO {'DBEnvironmentName'} [AS {'ConnectionName'}]
           {:HostVariable1     } [   {:HostVariable2  }]

[USER {'UserID'      } [USING :HostVariable4]]
[     {:HostVariable3}                       ]
Parameters 

DBEnvironmentName       identifies the DBEnvironment to be used.
                        DBEnvironmentName cannot exceed 36 bytes.

HostVariable1           is a character string host variable containing
                        the name of a DBEnvironment.

ConnectionName          is a string literal identifying the name
                        associated with this connection.  This name must
                        be unique for each DBEnvironment connection
                        within an application or an ISQL session.
                        If a ConnectionName is not specified,
                        DBEnvironmentName is the default.  ConnectionName 
                        cannot exceed 128 bytes.

HostVariable2           is a character string host variable containing
                        the ConnectionName associated with this
                        connection.

UserID                  is a string literal identifying the user
                        associated with this connection.  UserID cannot
                        exceed 64 bytes.

HostVariable3           is a character string host variable containing
                        the UserID associated with this connection.

HostVariable4           is a character string host variable containing
                        the connection password associated with the
                        specified user identifier.  The connection
                        password assigned to HostVariable4 cannot exceed
                        64 bytes.

Description 

   *   ALLBASE/SQL creates an implicit, brief transaction when the
       CONNECT statement is issued.

   *   When the value of the autostart flag is ON, the CONNECT statement
       initiates a single-user DBE session if the DBECon file user mode
       is currently set to single and no other user is accessing the
       DBEnvironment.  A multiuser DBE session is established if the
       DBECon file user mode is currently set to MULTI.

   *   If the value of the autostart flag is OFF, the CONNECT statement
       is used to initiate a multiuser session after a START DBE
       statement has been processed.

   *   When more than one CONNECT statement is issued, the application
       (or ISQL) is currently connected to the DBEnvironment specified by
       the most recent CONNECT statement.  The current connection can be
       changed with the SET CONNECTION statement.

   *   The USER and USING clauses are implementation-defined features
       intended for use in determining if a CONNECT statement should be
       accepted or rejected.  They are not currently used by ALLBASE/SQL
       as criteria for accepting or rejecting a CONNECT statement.
       However, other database products in a network environment may
       require them in order to granulize authorization to a connection
       level.

Authorization 

You can use this statement if you have CONNECT or DBA authority for the
specified DBEnvironment.

Example 

A user begins a multiuser DBE session; autostart mode is ON. The PartsDBE
DBEnvironment is currently configured to operate in multiuser mode, so
other users can also initiate DBE sessions.

     CONNECT TO 'PartsDBE.SomeGrp.Acct'

A second user starts a DBE session with a file equation.

     FILE DBE = PartsDBE.SomeGrp.Acct

     CONNECT TO '*DBE'

Specifying a connection name

Parts1 is the connection name to be used with multi-connect
functionality.

     CONNECT TO 'PartsDBE.SomeGrp.Acct' AS 'Parts1'



MPE/iX 5.5 Documentation