ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Declare/cursor Question?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Declare/cursor Question?

    I have two embedded sql in my rpgle program. The first one is a DECLARE/CURSOR/OPEN/FETCH/CLOSE METHOD. The second on is the Select into method.

    Would my second select turn on end of file in my first sql?

    For some reason SQLCOD = 100 when I go back to my loop to read the next record after I perform my second SQL.

    I ran on the sql command line my first sql to see how many record it should read before it give me end of file and it should be two records but it is only reading one.

    Thank you in advance.

  • #2
    Was your other question answered?

    First I guess I should ask if you had enough information to close out your first question?


    Second: Would you upload your program (as attachment) so we can take a look @ it?


    Thanks
    Jimmy
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Here is my program.

      Why is sqlcod = 100 when there are more records to read?

      Thank you.
      Attached Files

      Comment


      • #4
        Lets try this

        Define a seperate cursor for the second SQL......
        Lets say C2.


        Jimmy
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          I clear sqlcod before I left the subroutine where my second sql is and It worked.

          Jimmy thank you for all your help.

          Comment

          Working...
          X