GETPREFERENCE___()

Other. Returns the value of a preference as set in the configuration file c8-server.conf.

Syntax

GETPREFERENCEBOOLEAN( section, preference [, default] ) GETPREFERENCEINTEGER( section, preference [, default] ) GETPREFERENCELONG( section, preference [, default] ) GETPREFERENCESTRING( section, preference [, default] )
Parameters

section

The full path to the section containing the preference. See "Configuring Sybase CEP Engine" in the Sybase CEP Installation Guide for more information about the configuration file and the preference settings in it.

name

The name of the preference.

default

Return this value if the specified preference is not found. If omitted and the preference is not found, the function returns FALSE, 0, or the empty string, depending on the return type.

Data Types

Return

section

preference

default

As specified in the function name

String

String

As specified in the function name.

Examples

In the following example, the GETPREFERENCEBOOLEAN function retrieves the value for the "EnableSSL" preference from the "SSL" subsection of the "Sybase/C8/Security" section of c8-server.conf. If no "EnableSSL" preference is specified, the function returns FALSE:

INSERT INTO OutStream
SELECT Hostname, GETPREFERENCEBOOLEAN("C8/Security/SSL", "EnableSSL")
FROM InStream;

In the following example, the GETPREFERENCEINTEGER function retrieves the value for the "LoadLimit" preference from the "Container" subsection of the "Sybase/C8/Server" section of the file c8-server.conf. If no "LoadLimit" preference is specified, the function returns 0. Since 0 is also the default setting for this preference, no additional default value is specified:

INSERT INTO OutStream
SELECT Hostname, GETPREFERENCEINTEGER("C8/Server/Container", "LoadLimit")
FROM InStream;

In the following example, the GETPREFERENCELONG function retrieves the value for the "SmallBlocksThreshold" preference of the "Sybase/C8/Memory" section of c8-server.conf. If no "SmallBlocksThreshold" preference is specified, the default value of 256 is returned:

INSERT INTO OutStream
SELECT Hostname, GETPREFERENCELONG("C8/Memory", "SmallBlocksThreshold", 256)
FROM InStream;

In the following example, the GETPREFERENCESTRING function retrieves the value for the "NodeURI" preference, which resides in the "ManagerCluster" subsection of the "HighAvailability" subsection of the "Manager" subsection "Sybase/C8/Server" section of c8-server.conf. If no "NodeURI" preference is specified, the function returns the message "NOT SPECIFIED":

INSERT INTO OutStream
SELECT Hostname, GETPREFERENCEINTEGER("C8/Server/Manager/HighAvailability/ManagerCluster", 
     "NodeURI", "NOT SPECIFIED")
FROM InStream;