EasyManua.ls Logo

Sybase Adaptive Server Anywhere - RETURN Statement

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
593
RETURN statement
Use this statement to exit from a function or procedure unconditionally,
optionally providing a return value.
RETURN [
expression
]
None.
None.
"CREATE FUNCTION statement" on page 445
"CREATE PROCEDURE statement" on page 453
"BEGIN statement" on page 404
A RETURN statement causes an immediate exit from a function or
procedure. If expression is supplied, the value of expression is returned as
the value of the function or procedure.
Statements following a RETURN statement are not executed.
Within a function, the expression should be of the same data type as the
function’s RETURNS data type.
Within a procedure, RETURN is used for Transact-SQL-compatibility, and
is used to return an integer error code.
SQL/92 Persistent stored module feature.
Sybase Transact-SQL procedures use the RETURN statement to
return an integer error code.
The following function returns the product of three numbers:
CREATE FUNCTION product (
a numeric,
b numeric,
c numeric )
RETURNS numeric
BEGIN
RETURN ( a * b * c );
END
Calculate the product of three numbers:
SELECT product (2, 3, 4)
product(2, 3, 4)
24
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility
Example

Table of Contents

Related product manuals