Mimer SQL User's Manual TOC PREV NEXT INDEX

Mimer Developer Site

www.mimer.com/developer


Calling Procedures


In addition to using data manipulation statements directly, as just described, it is also possible to manipulate table data by invoking a procedure. Procedures perform the specific data manipulations laid out in the procedure definition.

Any SQL statement in the grouping procedural-sql-statement, see the Mimer SQL Reference Manual for a definition, can be used in a procedure, and this includes all the data manipulation statements.

The use of procedures allows data manipulation within the database to be controlled both in terms of strictly defining which data manipulation operations are performed and also in terms of regulating which database objects can be affected.

A procedure is invoked by using the CALL statement. In the case of a result set procedure, used in an embedded SQL context, the CALL statement is not used directly but is specified in a cursor declaration. An ident requires EXECUTE privilege on a procedure in order to call it.

In the CALL statement, the value-expressions or assignment targets specified for each of the procedure parameters must be of data type which is assignment-compatible, see the Mimer SQL Reference Manual with the parameter data type.

See the Mimer SQL Reference Manual for full details of the CALL statement and of the Mimer SQL Programmer's Manual for a general discussion of the PSM functionality supported in Mimer SQL.

Examples of Calling Procedures

Invoke the procedure called ALLOCATE_ROOM:
 CALL ALLOCATE_ROOM(142,:room_no);
 
Declare a cursor which will be used when result-set data is fetched from the result set procedure called WAKE_UP.
 DECLARE room_nos CURSOR
     FOR CALL WAKE_UP(:query_interval);


Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL User's Manual TOC PREV NEXT INDEX