GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.voltdb.com — CREATE PROCEDURE AS DocumentationCREATE PROCEDURE ASCREATE PROCEDURE AS — Defines a stored procedure composed of a SQL query. SynopsisCREATE PROCEDURE procedure-name [ALLOW role-name [,...]] AS sql-statement CREATE PROCEDURE procedure-name [ALLOW role-name [,...]] AS ### source-code ### LANGUAGE GROOVY DescriptionYou 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 stored procedures directly within the schema definition. There are two forms of the CREATE PROCEDURE AS statement:
In both cases, 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. ExamplesThe following example defines a stored procedure, CountUsersByCountry, as a single SQL query with a placeholder for matching the country column: CREATE PROCEDURE CountUsersByCountry AS
SELECT COUNT(*) FROM Users WHERE country=?;The next example restricts access to the stored procedure to only users with the admin role: CREATE PROCEDURE ChangeAdminPassword ALLOW admin AS
UPDATE Accounts SET (HashedPassword=?) WHERE userID='root'; |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |