DROP CONNECTION statement

Use this statement to drop 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.

Permissions

Must have DBA authority.

Side effects

None.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following procedure drops a connection identified by its connection number. Note that 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;