Calling Procedures; Dropping Procedures - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Introduction to procedures

Calling procedures

Dropping procedures

232
The body of a procedure is a compound statement. The compound statement
starts with a
statement and concludes with an
BEGIN
of
, the compound statement is a single INSERT bracketed by BEGIN
new_dept
and END statements.
For more information, see "Using compound statements" on page 240
Parameters to procedures are marked as one of IN, OUT, or INOUT. All
parameters to the
new_dept
changed by the procedure.
A procedure is invoked with a CALL statement. Procedures can be called by
an application program, or they can be called by other procedures.
For more information, see Adaptive Server IQ Reference Manual.
The following statement calls the
Sales department:
CALL new_dept( 210, 'Eastern Sales', 902 );
After this call, you may wish to check the department table to see that the new
department has been added.
The
procedure can be called by all users who have been granted
new_dept
EXECUTE permission for the procedure, even if they have no permissions on
the
table.
department
Once a procedure is created, it remains in the database until it is explicitly
removed. Only the owner of the procedure or a user with DBA authority can
drop the procedure from the database.
The following statement removes the procedure
DROP PROCEDURE new_dept
END
procedure are IN parameters, as they are not
procedure to insert an Eastern
new_dept
new_dept
statement. In the case
from the database:

Advertisement

Table of Contents
loading

Table of Contents