Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Unanswered: Passing cursor Into SQL SP With JDBC

    Does anyone know, if there is a way to pass a cursor into a DB2 SQL stored procedure, (DB2 v8.1)?

    A cursor is originally obtained from a JDBC call to a SQL stored procedure. The Java application making the JDBC call contains the decisioning logic to determine if the rows in the cursor/ResultSet need additional processing. The additional processing is done for all rows in the cursor. if the procesing is required, the cursor needs to be passed into a seperate SP that does the processing.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    That is not (yet) supported. You will have to fetch all rows from the cusor, write the data into another table, and then call the SP. The SP has to access the table to retrieve the data that way.

    However, the real question is why you want to fetch the rows from the server, process them at the client, and send them back instead of simply doing the whole prossing at the server. You would avoid a network round trip.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Apr 2005
    Posts
    2
    Thank you for your reply! The lack of any liturature explaining how to do so, hinted at the fact that it was not supported. But, I could not find anything explicitely saying so. Thanks for confirming!

    We have also considered temporary tables.

    Why? We are begining to explore the use of a rules engine to provide a variety of decoupled services. The services can be declaritively chained together. However, a challenge was how to let one service know what records the predecessor service has modified.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Quote Originally Posted by Craig Kemple
    Why? We are begining to explore the use of a rules engine to provide a variety of decoupled services. The services can be declaritively chained together. However, a challenge was how to let one service know what records the predecessor service has modified.
    One thing that you could consider is to wrap the rules engine and its services in stored procedures themselves. Then you can possibly just pass ids around, or have the rules engines work on the same table. Or you could use nested result sets, i.e. use objects that are a result set and operate on another result set to do filtering or whatever.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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