EasyManua.ls Logo

Sybase Adaptive Server Anywhere - CONNECT Statement [ESQL] [Interactive SQL]

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
423
CONNECT statement [ESQL] [Interactive SQL]
Use this statement to establish a connection to a database.
CONNECT
… [ TO
engine-name
]
… [ DATABASE
database-name
]
… [ AS
connection-name
]
… [ USER ]
userid
[ IDENTIFIED BY
password
]
engine-name
|
database-name
|
connection-name
|
userid
|
password
:
{
identifier
|
string
|
host-variable
}
CONNECT USING
connect-string
connect-string:
{
identifier
|
string
|
host-variable
}
None.
None.
"GRANT statement" on page 540
"DISCONNECT statement" on page 504
"SET CONNECTION statement" on page 610
"SETUSER statement" on page 617
"Connection parameters" on page 46
The CONNECT statement establishes a connection to the database identified
by database-name running on the server identified by engine-name.
Embedded SQL behavior In Embedded SQL, if no engine-name is
specified, the default local database server will be assumed (the first database
server started). If no database-name is specified, the first database on the
given server will be assumed.
The WHENEVER statement, SET SQLCA and some DECLARE statements
do not generate code and thus may appear before the CONNECT statement
in the source file. Otherwise, no statements are allowed until a successful
CONNECT statement has been executed.
The user ID and password are used for permission checks on all dynamic
SQL statements.
You can connect without explicitly specifying a password by using a host
variable for the password and setting the value of the host variable to be the
null pointer.
$ For a detailed description of the connection algorithm, see
"Troubleshooting connections" on page 67 of the book ASA User’s Guide.
Function
Syntax 1
Syntax 2
Permissions
Side effects
See also
Description

Table of Contents

Related product manuals