GetProperty

Get the value of a system property. The properties are global and shared across scripts.

All property names are available on the Constants tab of the /lib/util/System SQL definition set.

Any one of the following property names can be submitted to get its value:

CLUSTER_ID: The server’s cluster ID.
CURRENT_USER_DOMAIN: The current user’s domain.
CURRENT_USER_ID: A current user’s ID as a numeric value.
CURRENT_USER_NAME: The current user’s name.
SERVER_HOSTNAME: The server’s host name.
SERVER_ID: The server’s ID.
SERVER_JDBC_PORT: The server’s JDBC port.
SERVER_VERSION: The server’s software version string.
SERVER_VERSION_NUMBER: The server’s software version number only.
SERVER_WEB_PORT: The server’s HTTP port.
SESSION_ID: The session ID.
TRANSACTION_ID: The transaction ID.

Location

/lib/util/

Syntax

getProperty (
IN propertyName VARCHAR (255),
OUT propertyValue VARCHAR (4096))

Input

propertyName: The name of the property. (See list above.)

Output

propertyValue: The text to write to the debug console.

Exception

IllegalArgumentException: If an unsupported property name is requested.

Example

PROCEDURE proc5()
    BEGIN
        DECLARE x VARCHAR(4096);
        CALL getProperty('CURRENT_USER_ID', x);
        CALL log(x);
        CALL getProperty('CURRENT_USER_NAME', x);
        CALL log(x);
        CALL getProperty('CURRENT_USER_DOMAIN', x);
        CALL log(x);
    END