EasyManua.ls Logo

Sybase Adaptive Server Anywhere - EXECUTE Statement [T-SQL]

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...
EXECUTE statement [T-SQL]
516
EXECUTE statement [T-SQL]
Use this statement to invoke a procedure, as an Adaptive Server Enterprise-
compatible alternative to the CALL statement.
EXECUTE [
@return_status
= ] [
creator
.]
procedure_name
… | [
@parameter-name
= ]
expression
,
| [
@parameter-name
=]
@variable
[
output
]|,
Must be the owner of the procedure, have EXECUTE permission for the
procedure, or have DBA authority.
None.
"CALL statement" on page 410
The EXECUTE statement executes a stored procedure, optionally supplying
procedure parameters and retrieving output values and return status
information.
The EXECUTE statement is implemented for Transact-SQL compatibility,
but can be used in either Transact-SQL or Watcom-SQL batches and
procedures.
The following procedure illustrates the EXECUTE statement.
CREATE PROCEDURE p1( @var INTEGER = 54 )
AS
PRINT ’on input @var = %1!’, @var
DECLARE @intvar integer
SELECT @intvar=123
SELECT @var=@intvar
PRINT ’on exit @var = %1!’, @var
The following statement executes the procedure, supplying the input
value of 23 for the parameter. If you are connected from an Open Client
or JDBC application, the PRINT messages are displayed on the client
window. If you are connected from an ODBC or Embedded SQL
application, the messages are displayed on the database server window.
EXECUTE p1 23
The following is an alternative way of executing the procedure, which is
useful if there are several parameters.
EXECUTE p1 @var = 23
The following statement executes the procedure, using the default value
for the parameter
EXECUTE p1
Function
Syntax
Authorization
Side effects
See also
Description
Example

Table of Contents

Related product manuals