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 functions » Functions

EXTENDED_PROPERTY function [System]

Returns the value of the given database server property. Allows an optional property-specific string parameter to be specified.

Syntax
EXTENDED_PROPERTY( 
{ property-id | property-name }
[, property-specific-argument]
)
Parameters
  • property-id

    An integer that is the property number of the database server property. This number can be determined from the PROPERTY_NUMBER function. The property-id is commonly used when looping through a set of properties.

  • property-name

    The database server property name to query.

    • HasSecureFeatureKey

      Specify a list of features to determine whether the database server has a secured feature key that unlocks all of the features in the list. Returns NULL if property-specific-argument is NULL; otherwise returns Yes or No.

    • HasSecuredFeature

      Specify a list of features to determine whether any of the specified features is secured at the global server level. Returns NULL if property-specific-argument is NULL; otherwise returns Yes or No.

  • property-specific-argument

    The following database server properties allow you to specify additional arguments, as noted below, to return specific information about the property.

    • HasSecureFeatureKey feature-list

      Specify a list of features to determine whether there is a secure feature key that unlocks all of the features in feature-list.

    • HasSecuredFeature feature-list

      Specify a list of features to determine whether at least one of these features is secured.

Returns

VARCHAR, LONG VARCHAR

Remarks

The EXTENDED_PROPERTY function is similar to the PROPERTY function except that it allows an optional property-specific-argument string parameter to be specified. The interpretation of property-specific-argument depends on the property ID or name specified in the first argument.

Privileges

No privileges are required to execute this function.

NULL is returned if you specify an invalid parameter value.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

Execute the following statement to determine whether the xp_cmdshell system procedure can be used on the current connection without requiring a key:

SELECT EXTENDED_PROPERTY( 'HasSecuredFeature', 'cmdshell' );

If the CMDSHELL feature is not secured, the statement returns No. If the CMDSHELL feature is secured and a secured feature key is required to access the feature, the statement returns Yes.

Execute the following statement to determine whether there is a secured feature key that allows access to the CMDSHELL feature:

SELECT EXTENDED_PROPERTY( 'HasSecureFeatureKey', 'cmdshell' );

If there is no secured feature key available, the statement returns No. If there is a secured feature key that would permit access to this feature, the statement returns Yes.

Execute the following statement to determine whether the current connection can perform BACKUP and RESTORE statements without requiring a key..

SELECT EXTENDED_PROPERTY( 'HasSecuredFeature', 'backup,restore' );

If none of the features are secured, the statement returns No. If any feature is secured, the statement returns Yes. To determine if both features are secured, execute the following statement and check both results.

SELECT EXTENDED_PROPERTY( 'HasSecuredFeature', 'backup' ) AS [backup],
    EXTENDED_PROPERTY( 'HasSecuredFeature', 'restore' ) AS [restore];

Execute the following statement to determine whether there is a secure feature key that allows the current connection to perform BACKUP and RESTORE statements.

SELECT EXTENDED_PROPERTY( 'HasSecureFeatureKey', 'backup,restore' );

If there is a key that enables both features, the statement returns Yes. If any feature cannot be enabled by at least one key, the statement returns No.