Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    1

    Lightbulb Unanswered: problem with simple select query

    Hi,
    In my cobol-ims-db2 application program, I have a simple SELECT query. First value from input is moved to the keys in the query section. I'm getting the proper output. (SQLCODE =0).
    After reading the second record from the file, key is moved perfectly. (I found out by giving display statements before the call). But I'm getting +100 row not found error. But actually I've the same row in the table.

    This problem happens if WHENEVER I have any row in the second row.

    I ran the program with single row in the input file. My program RAN FINE WITHOUT ANY ABEND. I tried to expedite the program. But no use.

    Any suggestions??

    Thanks,
    Ranjini.S

  2. #2
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Please post your cursor defintion and the sections in which you OPEN/FETCH/CLOSE the cursor.

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    To obtain values from the same row of your cursor, after the first fetch, don't FETCH a second time since that would (try to) get the second row which doesn't exist.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  4. #4
    Join Date
    Dec 2005
    Posts
    273
    Ranjini, did I understand your problem correctly:

    You have a file containing some keys.
    You read the first record from the file and SELECT INTO data using the key in the WHERE clause which runs fine.
    Then you read the second key from the file, again do the SELECT INTO using the new key and that select fails with SQLCODE +100 ?

    You DISPLAYed the key to check, whether it was the correct one ?
    The program runs fine if there is only one record in your file.

Posting Permissions

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