![]() |
|
Use the CREATE ROUTINE FROM statement to access a user-defined routine (UDR). The actual text of the CREATE FUNCTION or CREATE PROCEDURE statement resides in a separate file.
An Informix ESQL/C program cannot directly define a UDR. That is, it cannot contain the CREATE FUNCTION or CREATE PROCEDURE statement. The following steps describe how you can use a UDR in an ESQL/C program:
The filename that you provide is relative. If you provide a simple filename, 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. However, if you do know if the UDR is a function or procedure, Informix recommends that you use the matching statement to access the source file:
Use of the matching statements improves the readability of the code.
Related statements: CREATE FUNCTION, CREATE FUNCTION FROM, CREATE PROCEDURE, and CREATE PROCEDURE FROM