ALLBASE/SQL Reference Manual (36216-90216)

Chapter 10 341
SQL Statements A - D
CREATE PROCEDURE
Parameters—ParameterDeclaration
ParameterName
is the name assigned to a parameter in the procedure. No two
parameters in the procedure can be given the same name. You can define
no more than 1023 parameters in a procedure.
ParameterType
indicates what type of data the parameter will contain. The
ParameterType
cannot be a LONG data type. For a list of data types,
refer to the "Data Types" chapter.
ParameterLanguage
specifies the language for the parameter. A LANG may only be
specified for a parameter with a character data type.This language may be
either the language of the procedure or n-computer. The default is the
language of the procedure.
DefaultValue
specifies the default value for the parameter. The default can be a
constant, NULL, or a date/time current function. The data type of the
default value must be compatible with the data type of the column.
NOT NULL means that the parameter cannot contain null values. If NOT NULL is
specified, any statement that attempts to place a null value in the
parameter is rejected.
OUTPUT specifies that the parameter can be used for procedure output as well as
input (the default). If OUTPUT is
not
specified, the parameter can only be
used for input to the procedure.
If procedure output is required, OUTPUT must also be specified for any
corresponding parameter in the EXECUTE PROCEDURE statement.
ONLY specifies that the parameter can be used for procedure output only. ONLY
should be used, when applicable, to avoid unnecessary initialization of
procedure parameters.
You must also specify OUTPUT for any corresponding parameter in the
EXECUTE PROCEDURE statement.
The DEFAULT option cannot be specified for OUTPUT ONLY parameters.
SQL Syntax—ResultDeclaration
ResultType
[LANG =
ResultLanguage
][NOT NULL]
Parameters—ResultDeclaration
ResultType
indicates the data type of a result column in a query result for a query or
queries in the procedure. The "Data Types" chapter describes the data
types available in ALLBASE/SQL.
ResultLanguage
specifies the language of the result column. A LANG may only be
specified for a result column with a character data type. This language
may be either the language of the procedure or n-computer. The default is
the language of the procedure.
NOT NULL indicates that the result column cannot contain null values.