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

START



>>-START---+-----------------------+---------------------------->
           '-stored_statement_name-'
 
>-----+--------------------------+-----------------------------><
      |    .--------------.      |
      |    V              |      |
      '-(-----parameter---+---)--'
 

START is an ISQL command that causes a stored SQL statement or the current SQL statement to be processed.

The START command can be invoked by pressing PF2. The START command can be invoked by pressing PF2 (or PF14). Because you can reset your PF keys, you can assign the START function to any PF key.

stored_statement_name
is the name of the stored SQL statement to be started. The name PREVIOUS is not allowed. To start the previous SQL statement, you must first recall it to the command buffer and enter START without supplying a name. If stored_statement_name is not specified, or START PF is pressed, the current SQL statement is started.

parameter
is the parameter to be substituted for the placeholders in the SQL statement. If you use more than one parameter, separate them with 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.

All placeholders in the SQL statement that do not have a corresponding parameter on the START command are replaced by null characters or are erased. Extra parameters on the START command are ignored.

The parameter can contain DBCS characters.

Example

Assume you have the following SQL statement stored as SELPD:

   select &1,&2,&3 -
   from emp_act -
   where actno = &4 -
     or emstdate = '&5'

You could type the START command as:

   start selpd (empno actno emptime 90 '1982-06-01')

The resulting statement started is:

   select empno,actno,emptime -
   from emp_act -
   where actno = 90 -
     or emstdate = '1982-06-01'

Notice that single quotation marks are needed around the &5 placeholder in the stored SQL statement because that placeholder stands for a character data item. Single quotation marks are not needed around &4 because &4 stands for a numeric data item. Single quotation marks are not needed for &1, &2, and &3 because they do not contain any blanks.

In a stored SQL statement, you can only use the ampersand (&) to create placeholders.

In the above example, the formatting information is not saved because placeholders are used in the SELECT clause.


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