HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems > Chapter 12 SQL Statements S - Z

SET CONNECTION

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The SET CONNECTION statement sets the current connection within the list of connected DBEnvironments. Any SQL statements issued apply to the current connection.

Scope

ISQL or Application Programs

SQL Syntax

  SET CONNECTION {'ConnectionName' 
                  :HostVariable   }

Parameters

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. ConnectionName cannot exceed 128 bytes.

HostVariable

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

Description

  • A connection to any one of the list of connected DBEnvironments can be the current connection. When the current connection is set from one DBEnvironment to another, any previously connected DBEnvironment is said to be suspended.

  • If a previously suspended DBEnvironment connection again becomes the current connection, all DBEnvironment context information for the current connection is restored to the same state as at the time when the DBEnvironment was suspended.

  • A connection with the DBEnvironment referenced in this statement must have previously been established using either a CONNECT, START DBE, START DBE NEW, or START DBE NEWLOG statement. This connection must not have been terminated by a DISCONNECT, RELEASE, or STOP DBE statement.

  • No stored section is created for the SET CONNECTION statement. SET CONNECTION cannot be used with the PREPARE or EXECUTE IMMEDIATE statements or procedures.

  • An active transaction is not required to execute a SET CONNECTION statement. An automatic transaction will not be started when executing a SET CONNECTION statement.

Authorization

You do not need authorization to use the SET CONNECTION statement.

Example

Establish two connections:

   CONNECT TO :PartsDBE AS 'Parts1'
   CONNECT TO :SalesDBE AS 'Sales1'

At this point, Sales1 is the current connection.

.
.
.

Set the current connection to Parts1:

   SET CONNECTION 'Parts1'
Feedback to webmaster