Sybase Adaptive Server Anywhere Reference page 442

Table of Contents

Advertisement

CONNECT statement [ESQL] [Interactive SQL]
424
Interactive SQL behavior
CONNECT statement, Interactive SQL remains connected to the current
database, rather than to the default server and database. If a database name is
specified without a server name, Interactive SQL attempts to connect to the
specified database on the current server. If a server name is specified without
a database name, Interactive SQL connects to the default database on the
specified server.
For example, if the following batch is executed while connected to a
database, the two tables are created in the same database.
CREATE TABLE t1( c1 int )
go
CONNECT DBA IDENTIFIED BY SQL
go
CREATE TABLE t2 (c1 int )
go
No other database statements are allowed until a successful CONNECT
statement has been executed.
The user ID and password are used for checking the permissions on SQL
statements. If the password or the user ID and password are not specified, the
user will be prompted to type the missing information.
In Interactive SQL running in command prompt mode or batch mode, if you
execute CONNECT without an AS clause, an unnamed connection is
opened. If there is another unnamed connection already opened, the old one
is automatically closed. Otherwise, existing connections are not closed when
you run CONNECT.
In the Interactive SQL user interface, CONNECT opens another window and
a new database connection for that window. It does not close any existing
windows which happen to have unnamed connections.
Multiple connections are managed through the concept of a current
connection. After a successful connect statement, the new connection
becomes the current one. To switch to a different connection, use the
SET CONNECTION statement. The DISCONNECT statement is used to
drop connections.
Connecting with no password
DBA authority, you can connect to another user ID without specifying a
password. (The output of
are connected to a database from Interactive SQL as DBA, you can connect
without a password with the statement:
CONNECT other_user_id
Syntax 2
A connect-string is a list of parameter settings of the form
keyword=value, and must be enclosed in single quotes.
If no database or server is specified in the
If you are connected to a user ID with
dbtran
requires this capability.) For example, if you

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

Subscribe to Our Youtube Channel

Table of Contents