When you are finished working with a database, you can disconnect from it. SQL Anywhere also gives you the ability to disconnect other users from a given database; for more information about doing this in Sybase Central, see Managing connected users.
When a database server is started, it assigns a unique connection ID to each new connection to the database server. You can obtain a user's connection-id using the CONNECTION_PROPERTY function to request the connection number. The following statement returns the connection ID of the current connection:
SELECT CONNECTION_PROPERTY( 'number' ); |
See DISCONNECT statement [ESQL] [Interactive SQL] and DROP CONNECTION statement.
The following statement shows how to use the DISCONNECT statement to disconnect the current connection, conn1, in Interactive SQL:
DISCONNECT conn1; |
The following statement shows how to use DISCONNECT in embedded SQL:
EXEC SQL DISCONNECT :conn-name |
To disconnect other users from a database (SQL)
Connect to the database as a user with DBA authority.
Use the sa_conn_info system procedure to determine the connection ID of the user you want to disconnect.
Execute a DROP CONNECTION statement.
The following statement drops connection number 4.
DROP CONNECTION 4; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |