CREATE PROCEDURE syntax
Go Up to Creating Procedures
CREATE PROCEDURE name [(param datatype [, param datatype …])] [RETURNS (param datatype [, param datatype …])] AS <procedure_body>; <procedure_body> = [<variable_declaration_list>] <block> <variable_declaration_list> = DECLARE VARIABLE var datatype; [DECLARE VARIABLE var datatype; …] <block> = BEGIN <compound_statement> [<compound_statement> …] END <compound_statement> = {<block> | statement;}
Argument | Description |
---|---|
<name> |
Name of the procedure; must be unique among procedure, table, and view names in the database. |
<param> <datatype> |
Input parameters that the calling program uses to pass values to the procedure.
|
|
Output parameters that the procedure uses to return values to the calling program
|
|
Keyword that separates the procedure header and the procedure body. |
|
Declares local variables used only in the procedure
|
<statement> |
|