Returning Results From Procedures; Returning A Value Using The Return Statement - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Returning results from procedures

Notes
Returning results from procedures

Returning a value using the RETURN statement

246
Name
Fran Whitney
Matthew Cobb
Philip Chin
Julie Jordan
Robert Breault
...
Default parameters can be used in calling functions. However, parameters
cannot be passed to functions by name.
Parameters are passed by value, not by reference. Even if the function
changes the value of the parameter, this change is not returned to the
calling environment.
Output parameters cannot be used in user-defined functions.
User-defined functions cannot return result sets.
Procedures can return results that are a single row of data, or multiple rows. In
the former case, results can be passed back as arguments to the procedure. In
the latter case, results are passed back as result sets. Procedures can also return
a single value given in the RETURN statement.
For simple examples of how to return results from procedures, see
"Introduction to procedures". For more detailed information, see the following
sections.
A single value can be returned to the calling environment using the RETURN
statement, which causes an immediate exit from the procedure. The RETURN
statement takes the form:
RETURN expression
The value of the supplied expression is returned to the calling environment. To
save the return value in a variable, an extension of the CALL statement is used:

Advertisement

Table of Contents
loading

Table of Contents