SQL Anywhere uses the SET statement to assign values to variables in a procedure. In Transact-SQL, values are assigned using either the SELECT statement with an empty table-list, or the SET statement. The following simple procedure illustrates how the Transact-SQL syntax works:
CREATE PROCEDURE multiply @mult1 int, @mult2 int, @result int output AS SELECT @result = @mult1 * @mult2; |
This procedure can be called as follows:
CREATE VARIABLE @product int go EXECUTE multiply 5, 6, @product OUTPUT go |
The variable @product has a value of 30 after the procedure executes.
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |