CREATE PROCEDURE AS

CREATE PROCEDURE AS — Defines a stored procedure composed of a SQL query.

Synopsis

CREATE PROCEDURE procedure-name [ALLOW role-name [,...]] AS sql-statement

Description

You must declare stored procedures as part of the schema to make them accessible at runtime. The declared procedures are evaluated and included in the application catalog when you compile the database schema.

Use CREATE PROCEDURE AS when declaring simple stored procedures consisting of a single SQL query statement. The SQL statement can contain question marks (?) as placeholders that are filled in at runtime with the arguments to the procedure call.

The procedure name must follow the naming conventions for Java class names. For example, the name is case-sensitive and cannot contain any white space.

If security is enabled at runtime, only those roles named in the ALLOW clause have permission to invoke the procedure. If security is not enabled at runtime, the ALLOW clause is ignored and all users have access to the stored procedure.