ALLBASE/SQL Reference Manual (36216-90216)

Chapter 11 471
SQL Statements E - R
PRINT
PRINT
The PRINT statement is used inside a procedure to store the content of user-defined
strings, local variables, parameters, or built-in variables in the message buffer for display
by ISQL or an application program.
Scope
Procedures only
SQL Syntax
PRINT
{‘Constant’
:LocalVariable
:Parameter
::Built-inVariable
};
Parameters
Constant
is a string literal.
LocalVariable
is a local variable declared within the procedure. Types and sizes are the
same as for column definitions, except you cannot specify a LONG data
type.
Parameter
is a parameter declared within the procedure.
Built-inVariable
is one of the following built-in variables used for error handling:
::sqlcode
::sqlerrd2
::sqlwarn0
::sqlwarn1
::sqlwarn2
::sqlwarn6
::activexact
The first six of these have the same meaning that they have as fields in the
SQLCA in application programs. Note that in procedures, sqlerrd2 returns
the number of rows processed for all host languages. However, in
application programs, sqlerrd3 is used in COBOL, Fortran, and Pascal,
while sqlerr2 is used in C. ::activexact indicates whether a transaction is
in progress or not. For additional information, refer to the application
programming guides and to the chapter "Constraints, Procedures, and
Rules."