Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Creating User-Defined Routines > Developing a User-Defined Routine > Registering a C UDR >

The UDR Language

The LANGUAGE clause of the CREATE FUNCTION or CREATE PROCEDURE statement tells the database server in which language the UDR is written. For C UDRs, the LANGUAGE clause must be as follows:

LANGUAGE C

The database server stores valid UDR languages in the sysroutinelangs system catalog table. These statements store the UDR language as an integer, called a language identifier, in the langid column of the sysprocedures system catalog table.

By default, only users with DBA privilege have the Usage privilege on the C language for UDRs. These users include user informix and the user who created the database. If you attempt to execute the CREATE FUNCTION or CREATE PROCEDURE statement with the LANGUAGE C clause as some other user, the database server generates an error.

To allow other users to register C UDRs in the database, a user with the DBA privilege can grant the Usage privilege on the C language with the GRANT statement. The following GRANT statement allows any user to register C UDRs:

GRANT USAGE ON LANGUAGE C TO public;

This statement stores the UDR-language privileges in the syslangauth system catalog table. By default, Usage privilege on C is only granted to the DBA. For more information on the syntax of the GRANT statement, see the IBM Informix: Guide to SQL Syntax.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]