Creating a native SQL stored procedure


Use the following procedure to create a native SQL stored procedure.

  1. On the BMC AMI Change Manager for Db2 Main Menu, select WORKID, and press Enter.
  2. On the WORKID Action Menu, type the name of the WORKID or type a wildcard pattern to display a list of work IDs. Then, select Specify Db2 definitions and press Enter.
  3. On the Object Specification panel, specify the name of a stored procedure (or use wildcard characters). Then, press Enter.
  4. On the Command line of the Mixed List panel, type CSP.
  5. Specify the options for the native SQL stored procedure.
    1. At Procedure Version, type a value for the version or leave the value blank. The version must begin with an alphabetic character. Db2 defaults the value to V1.
    2. At Origin, type N (native).
    3. At Language, type SQL.
    4. Specify any other options for the procedure.
    5. Press Enter.
  6. To specify additional options for the native SQL stored procedure, type S to select Proc Options.
  7. On the Create Native Procedure Options panel, modify the options, and then press END to return to the Create Procedure panel.
  8. On the Create Procedure panel, to specify the parameters for the native SQL stored procedure, type S to select Parameters.
  9. On the Procedure Parameter List panel, specify the parameters, and then press END to return to the Create Procedure panel.
  10. On the Create Procedure panel, to specify the comment for the native SQL stored procedure, type S to select Comment.
  11. On the Procedure Comment panel, modify the comment, and then press END to return to the Create Procedure panel.
  12. Specify the text for the native SQL stored procedure.
    1. Type S to select Text.The product invokes the ISPF editor.
    2. Type the text for the body of the procedure.If the body exceeds the width of the screen, you can scroll the panel to the right to provide additional text.
    3. Press END.
  13. To specify the path for the native SQL stored procedure, type S to select Path.
  14. On the Procedure Package Path panel, modify the path, and then press END to return to the Create Procedure panel.
  15. Press END.Now that the create the stored procedure has been created, you can analyze a work ID and execute a worklist.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*