Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525

    Unanswered: Allocate cursor problem???

    I'm attempting (very poorly) to work with results sets returned from a nested procedure call.

    According to the IBM documentation, this can be done as follows...

    DECLARE my_results RESULT_SET_LOCATOR VARYING;

    CALL target_procedure(var1);

    ASSOCIATE RESULT SET LOCATORS(my_results)
    WITH PROCEDURE target_procedure;

    ALLOCATE my_cursor CURSOR FOR my_results;

    The problem I have is that I cannot get the SP to compile when I include the ALLOCATE statement. I get an unexpected token error, SQLSTATE=42601.

    What am I doing wrong???

    Thanks in anicipation.

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    Okay... so, elsewhere in the IBM documentation it states the correct syntax for the 'allocate cursor' statement:

    ALLOCATE my_cursor CURSOR FOR RESULT SET my_results;

    If anybody is interested, I've attached the SPs that I've been using to test this concept (there's other unrelated rubbish in there that I've used before).

    Cheers.
    Attached Files Attached Files

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Damian

    Thanks for keeping the group updated on the progress of your post ...

    It will be very good if everyone else does the same ....

    Cheers

    Sathyaram

    Originally posted by Damian Ibbotson
    Okay... so, elsewhere in the IBM documentation it states the correct syntax for the 'allocate cursor' statement:

    ALLOCATE my_cursor CURSOR FOR RESULT SET my_results;

    If anybody is interested, I've attached the SPs that I've been using to test this concept (there's other unrelated rubbish in there that I've used before).

    Cheers.

Posting Permissions

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