Sybase Adaptive Server Anywhere Reference page 443

Table of Contents

Advertisement

Parameters
Standards and
compatibility
Examples
$
For more information on connection strings, see "Connection
parameters" on page 64 of the book ASA User's Guide.
AS clause
A connection can optionally be named by specifying the AS
clause. This allows multiple connections to the same database, or multiple
connections to the same or different database servers, all simultaneously.
Each connection has its own associated transaction. You may even get
locking conflicts between your transactions if, for example, you try to
modify the same record in the same database from two different connections.
Syntax 1 is a full SQL feature; syntax 2 is a vendor extension.
SQL/92
Open Client Embedded SQL supports a different syntax for
Sybase
the CONNECT statement.
The following are examples of CONNECT usage within Embedded
SQL.
EXEC SQL CONNECT AS :conn_name
USER :userid IDENTIFIED BY :password;
EXEC SQL CONNECT USER "dba" IDENTIFIED BY "sql";
Connect to a database from Interactive SQL. Interactive SQL prompts
for a user ID and a password.
CONNECT
Connect to the default database as DBA, from Interactive SQL.
Interactive SQL promptS for a password.
CONNECT USER "DBA"
Connect to the sample database as the DBA, from Interactive SQL.
CONNECT
TO asademo
USER DBA
IDENTIFIED BY sql
Connect to the sample database using a connect string, from
Interactive SQL.
CONNECT
USING 'UID=DBA;PWD=sql;DBN=asademo'
Chapter 9 SQL Statements
425

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?

Questions and answers

Table of Contents