DB2 Server for VSE & VM: Interactive SQL Guide and Reference

RUN



>>-RUN---routine_name----+--------------------------+----------><
                         |    .--------------.      |
                         |    V              |      |
                         '-(-----parameter---+---)--'
 

RUN is an ISQL command that starts the processing of a routine.

You can run another user's routine if you have obtained the SELECT privilege by a GRANT statement on that user's ROUTINE table. Once you have the SELECT privilege on the user's ROUTINE table, you can run those routines by qualifying the routine name with the owner's authorization ID. For example, to run a routine called REPORTS that is owned by a user whose authorization ID is MIKE, you use:

   run mike.reports

You do not have to identify the table name, ROUTINE, because the name of everyone's routine table is the same. Care must be taken in running another user's routine because any stored SQL statements or synonyms used in a routine are not recognized unless you have also defined them.

Parameters can also be passed to the routine by including them on the RUN command.

routine_name
is the name of the routine to be run.

parameter
is the parameter to be substituted for placeholders in the commands contained in the named routine. If more than one parameter is used, separate them by blanks.

Enclose a parameter in single quotation marks if it contains a blank. Any characters between the terminating single quotation mark and the next blank are ignored.

If there are more placeholders in the routine than there are parameters on the RUN command, the extra placeholders are replaced by null characters. Extra parameters on the RUN command are ignored.

Example

The following command executes your routine named SAMPLE and provides three parameters:

   run sample (BLUE RED,GREEN 'WHITE BLACK')

The placeholders (indicated by &) in the routine are replaced by:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]