HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems > Chapter 10 SQL Statements A - D

CONNECT

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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'
              :HostVariable1      }[AS {'ConnectionName'
                                        :HostVariable2   }]
  [USER {'UserID'
         :HostVariable3}[USING :HostVariable4]]

Parameters

DBEnvironmentName

identifies the DBEnvironment to be used. Any path name you specify, unless absolute, is assumed to be relative to your current working directory.

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 whose current working directory is just above the sampledb directory begins a DBE session; the value of the 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 'sampledb/PartsDBE'

A second user starts a DBE session from a different directory.

   CONNECT TO '../sampledb/PartsDBE'

Specifying a connection name

   CONNECT TO 'sampledb/PartsDBE' AS 'Parts1'

Parts1 is the connection name to be used with multiconnect functionality.

Feedback to webmaster