Verifying Procedure Input Arguments; Statements Allowed In Batches - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Verifying procedure input arguments

Statements allowed in batches

You can verify that input arguments to a procedure are passed correctly in
several ways.
You can display the value of the parameter on the message window of the
server using the MESSAGE statement. For example, the following procedure
simply displays the value of the input parameter var:
CREATE PROCEDURE message_test (IN var char(40))
BEGIN
MESSAGE var;
END
You can do the following from Interactive SQL:
Create the procedure.
Call the procedure:
CALL MESSAGE_TEST ('Test Message');
After calling the procedure on a Windows NT system, double click the
server icon in the system tray to ensure that the message was passed
properly to the server.
SELECT GLOBALVAR
The following statements are not allowed in batches:
CONNECT or DISCONNECT statement
ALTER PROCEDURE or ALTER FUNCTION statement
DBISQL commands such as OUTPUT
Otherwise, any SQL statement is allowed, including data definition statements
such as CREATE TABLE, ALTER TABLE, and so on.
The CREATE PROCEDURE statement is allowed, but must be the final
statement of the batch. Therefore a batch can contain only a single CREATE
PROCEDURE statement.
CHAPTER 6
Using Procedures and Batches
267

Advertisement

Table of Contents
loading

Table of Contents