Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

DROP CONNECTION statement

Drops a user's connection to the database.

Syntax
DROP CONNECTION connection-id
Remarks

The DROP CONNECTION statement disconnects a user from the database by dropping the connection to the database.

The connection-id parameter is an integer constant. You can obtain the connection-id using the sa_conn_info system procedure.

This statement is not supported in procedures, triggers, events, or batches.

Privileges

You must have the DROP CONNECTION system privilege.

Side effects

None.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

The following procedure drops a connection identified by its connection number. When executing the DROP CONNECTION statement from within a procedure, you should do so using the EXECUTE IMMEDIATE statement, as shown in this example:

CREATE PROCEDURE drop_connection_by_id( IN conn_number INTEGER )
 BEGIN
   EXECUTE IMMEDIATE 'DROP CONNECTION ' || conn_number;
 END;

The following statement drops the connection with ID number 4.

DROP CONNECTION 4;