Language-Level Privileges

HCL OneDB™ also supports language-level privileges, which specify the programming languages of UDRs that users who have been granted Usage privileges for a given language can register in the database.

This is the syntax of the USAGE ON LANGUAGE clause for granting Usage privileges on a programming language:

Language-Level Privileges

1  USAGE ON LANGUAGE
2.1 SPL
2.1 C
2.1 JAVA

The SPL, C, and JAVA keywords can specify a programming language in the USAGE ON LANGUAGE clause. Each GRANT USAGE ON LANGUAGE statement can specify no more than one programming language. By default, Usage privilege on SPL is granted to PUBLIC.

When a user executes the CREATE FUNCTION or CREATE PROCEDURE statement to register a UDR that is written in the SPL, C, or Java™ language, the database server verifies that the user has the Usage privilege on the language in which the UDR is written. If the IFX_EXTEND_ROLE configuration parameter has enabled the built-in EXTEND role, only users who also hold that role can register or drop UDRs written in the C language or in the Java language, even if the users hold USAGE ON LANGUAGE privileges for those languages.

The GRANT USAGE ON LANGUAGE statement can grant Usage privilege on a programming language to a restricted group of users. The following example grants Usage privileges on the C language to a user-defined role named developers:
GRANT USAGE ON LANGUAGE C TO developers;
If the preceding example executes successfully, users who hold the developers role as their current role can create or drop C routines (if they also hold the EXTEND role, or if the IFX_EXTEND_ROLE parameter is set to 0 or to Off).

For information on other access privileges that these statements require, see CREATE FUNCTION statement and CREATE PROCEDURE statement.