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

NOTIFY SEMAPHORE statement

Increments the counter associated with a semaphore.

Syntax
NOTIFY SEMAPHORE [ owner.]semaphore-name 
[ INCREMENT BY number ]
Parameters
  • owner

    The owner of the semaphore. owner can also be specified using an indirect identifier (for example, `[@variable-name]`).

  • semaphore-name

    The name of the semaphore. semaphore-name can also be specified using an indirect identifier (for example, `[@variable-name]`).

  • INCREMENT BY clause

    Specify a positive integer to indicate how much to increment the counter associated with the semaphore. If this clause is not specified, then the counter is incremented by 1.

    number can be specified using a variable (for example, INCREMENT BY @inc-number).

    If you set number to NULL, or if it is set to a variable and the variable value is NULL, the behavior is equivalent to not specifying the clause.

Remarks

If the counter is 0, and a connection is blocked on a WAITFOR SEMAPHORE statement on this semaphore, the NOTIFY SEMAPHORE statement notifies the connection.

If a connection that notified a semaphore is dropped or canceled, the counter increment persists, so your application needs to be able to address this case.

Privileges

You must have the UPDATE ANY MUTEX SEMAPHORE system privilege, or be the owner of the semaphore.

Side effects

None.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

The following statement increments the counter for the license_counter semaphore by 1:

NOTIFY SEMAPHORE license_counter INCREMENT BY 1;