Embedded Usage
The embedded Create Procedure statement is identical to its interactive version, with the following exceptions and additions:
- Braces {} cannot be used in place of the begin and end clauses.
- All statements within the procedure must be separated by semicolons. The statement terminator after the final end clause follows the syntax of the host language.
- The Create Procedure statement cannot contain any references to host language variables.
- The rules for the continuation of statements over multiple lines follow the embedded SQL host language rules. String literals, continued over multiple lines, also follow the host language rules. For details about the continuation of database procedure statements and string literals, see the Embedded SQL Companion Guide.
- Comments within a procedure body follow the comment rules of the host language.
- The Include statement cannot be issued inside a database procedure. However, an include file can contain an entire Create Procedure statement.
The preprocessor does not validate the SQL syntax of the Create Procedure statement. The syntax is validated at runtime.
Permissions
You must have permission to access the tables and views specified in queries issued by the procedure. If the procedure uses database events owned by other users, you must have the required permissions (raise and register) on the database events. If the procedure executes database procedures owned by other users, you must have execute permission for those procedures.
If permissions are changed after the procedure is created and the creator of the procedure no longer has permissions to access the tables and views, a runtime error results when the procedure is executed.
The grant statement can be used to assign the [no]create_procedure privilege to specific users, groups, and roles.
Related Statements
Create Rule
Declare
Drop Procedure
Execute Procedure
Grant (privilege)
© 2007 Ingres Corporation.
All rights reserved.