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 » System procedures » Alphabetical list of system procedures

sa_user_defined_counter_set system procedure

Sets a user-defined counter to a specified value.

Syntax
sa_user_defined_counter_set( 
counter_name 
, value
[, apply_to_con
[, appy_to_db
[, apply_to_server ] ] ]
Parameters
  • counter_name

    Use this VARCHAR(128) parameter to specify the name of the user-defined counter whose value you want to change. Examples of user-defined counter names are UserDefinedCounterRate01 and UserDefinedCounterRaw01.

  • value

    Use this BIGINT parameter to specify the value to which the user-defined counter is set.

  • apply_to_con

    Use this INT parameter to specify whether to adjust the counter value for the current connection. 0 means do not adjust the value, and 1 means adjust the value. The default is 1.

  • apply_to_db

    Use this INT parameter to specify whether to adjust the counter value for the database. 0 means do not adjust the value, and 1 means adjust the value. The default is 0.

  • apply_to_server

    Use this INT parameter to specify whether to adjust the counter value for the database server. 0 means do not adjust the value, and 1 means adjust the value. The default is 0.

Returns

This function returns an INTEGER status code.

Remarks

This function returns 1 if value is defined, 0 if value is not defined, and an error code if an error occurs. Examples of errors include:

  • an invalid counter name
  • an invalid value for the apply_to_server, apply_to_db, or apply_to_con parameter.

Concurrent access to counters is applied atomically, so a counter value can be reset from multiple, concurrent requests.

User-defined counters are implemented as 32-bit UNSIGNED INTEGER values.

Privileges

You must have EXECUTE privilege on the system procedure, as well as the SERVER OPERATOR system privilege.

Side effects

None

Example

The following statement sets the value of UserDefinedCounterRate01 to 0 for the current connection, database, and database server:

SELECT sa_user_defined_counter_set( 'UserDefinedCounterRate01', 0, 1, 1, 1 );