>>-CREATE ROUTINE FROM--+-'file'---+--------------------------->< '-file_var-'
Element | Description | Restrictions | Syntax |
---|---|---|---|
file | Pathname and filename for the text of a CREATE PROCEDURE or CREATE FUNCTION statement. Default path is the current directory. | Must exist and can contain only one CREATE FUNCTION or CREATE PROCEDURE statement. | Operating-system dependent |
file_var | Name of a program variable that contains file specification | Must be a character data type; contents must satisfy file restrictions | Language specific |
ESQL/C programs cannot use the CREATE FUNCTION or CREATE PROCEDURE statement directly to define a UDR. You must instead do this:
The file specification that you provide is relative. If you include no pathname, the client application looks for the file in the current directory.
If you do not know at compile time whether the UDR in the file is a function or a procedure, use the CREATE ROUTINE FROM statement in the ESQL/C program. If you know whether the UDR is a function or a procedure, you can improve the readability of your code by using the matching SQL statement to access the source file:
When the IFX_EXTEND_ROLE configuration parameter is set to ON, only users to whom the Database System Administrator (DBSA) has granted the built-in EXTEND role can create external routines.
Routines use the collating order that was in effect when they were created. See SET COLLATION for information about using non-default collation.
Related statements: CREATE FUNCTION, CREATE FUNCTION FROM , CREATE PROCEDURE, and CREATE PROCEDURE FROM