Returning information from stored procedures

Stored procedures can return the following types of information:

Return status and return parameters allow you to modularize your stored procedures. A set of SQL statements that are used by several stored procedures can be created as a single procedure that returns its execution status or the values of its parameters to the calling procedure. For example, many Adaptive Server system procedures include another procedure that verifies certain parameters as valid identifiers.

Remote procedure calls, which are stored procedures that run on a remote Adaptive Server, also return both status and parameters. All the examples below can be executed remotely if the syntax of the execute statement includes the server, database, and owner names, as well as the procedure name.