Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Arrow Unanswered: Dynamic SQL in DB2 SQL stored procedure

    Hi Everyone,

    I am brand new to this DB2 stored procedure. In our project, we have a requirement to write dynamic SQL in DB2 stored procedure. We need to write dynamic SQL (which is basically business rules) as a rows of a table and we need to fetch it one by one as part of validation procedure so that when new business rule added or existing rule modified, we can simply go and update the table rather that modifying the validation procedure. So, my question is, how to write dynamic SQL as rows of a table and how to fetch it using a cursor or so..?

    Any help will be appreciated.

    Thank you,
    Manju

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    have a look in db2 directory sqllib/samples
    there are many samples supplied for any purpose....
    eg. dynamic.db2 in sqlproc...
    or in info center
    http://publib.boulder.ibm.com/infoce.../r0007623.html
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •