Drops a user's connection to the database.
DROP CONNECTION connection-id
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.
You must have the DROP CONNECTION system privilege.
None.
Not in the standard.
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;