Results 1 to 4 of 4

Thread: Opening Cursors

  1. #1
    Join Date
    Aug 2007
    Posts
    64

    Thumbs down Unanswered: Opening Cursors

    Dear Friends ,

    I am creating one DB2 procedure which contains 3 cursors . Now at the end of procedure i am opening all these cursors one by one.

    OPEN CURSOR1;
    OPEN CURSOR2;
    OPEN CURSOR3;

    When i execute this procedure i expect the resultset from the last cursor in the opened list(CURSOR3), but I am getting the resultset from the first opened cursor alone . Please suggest me whether all the cursors have opened in this case or only the first cursor has opened

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    have you defined the cursors with return - created proc with x resultsets...
    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

  3. #3
    Join Date
    Aug 2007
    Posts
    64
    Yes i defined procedure for 3 resultsets

    DYNAMIC RESULT SETS 3

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The question was how exactly you declared the cursors. Do you use the WITH RETURN TO CALLER or WITH RETURN TO CLIENT clause for all 3 of them?

    Could you reduce the SP code to still exhibit the problem and then post it here?
    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
  •