DB2 graphic  QMF Version 8

Running a stored procedure that contains input and output parameters

Stored procedure USERA.IOVCHAR has two parameters, an input and an output parameter which are both defined as VARCHAR 32KB character strings. The stored procedure copies the input string to the output string. You can enter your CALL statement using QMF global variables to handle the input and output parameters. The global variables can be declared before you run the CALL statement using the SET GLOBAL command. If you do not set the value prior to running the CALL statement, you will be prompted to enter a value. Issue the CALL statement on the SQL QUERY panel. Prompting will be used in the following example:

CALL USREA.IOVCHAR(&A01, &A02)

You enter your data on the lines provided in the prompt panel. You must enter a blank for the output parameter regardless of whether you use prompting or if you set the global variables before running the CALL statement.

Figure 180. Prompt panel- input and output parameters
  SQL QUERY                                                    MODIFIED LINE  1  

                  RUN Command Prompt - Values of Variables        1 to 10 of 10

  Your RUN command runs a query or procedure with variables that need
  values.  Fill in a value for each variable named below:

  &A01             'This is my string'
  &A02             ' '




  F1=Help   F3=End   F7=Backward   F8=Forward

  Please give a variable for each variable name.

Upon completion, you will see this message:

OK, Your Stored Procedure has successfully completed. 

You can view the output parameter in the global variable pool by using the SHOW GLOBALS command:

Figure 181. Viewing the output parameter by using SHOW GLOBALS
  GLOBALS

  Type a value for a global variable and press Enter or press a function
  key. Variable values may be changed if they are enclosed in parentheses
  or brackets.

  Variable Name:         Value:
  -------------------    ------------------------------------------------
                                                           1 to 11 of 113
  A02                    ( THIS IS MY STRING                      >
  DSQAO_APPL_TRACE         0
  DSQAO_ATTENTION          0
  DSQA)_BATCH              1
  DSQAO_CICS_SQNAME
  DSQAO_CICS_SQTYPE
  DSQAO_CICS_TQNAME
  DSQAO_CICS_TQTYPE
  DSQAO_CONNECT_ID         CACLARK
  DSQAO_CONNECT_LOC        MVS1DB2M
  DSQAO_CURSOR_OPEN        2

  1=Help   2=        3=End        4=      5=Show Field     6=Query
  7=Backward   8=Forward   9=Form   10=Add   11=Delete   12=Report
  OK,  GLOBALS IS SHOWN
  COMMAND ===>


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004