Returning results from procedures
246
Notes
•
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.
Returning results from procedures
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.
Returning a value using the RETURN statement
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:
Name
Fran Whitney
Matthew Cobb
Philip Chin
Julie Jordan
Robert Breault
...
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...