ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Records not fetched in SQLRPGLE

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

  • Records not fetched in SQLRPGLE

    Few records were not fetched from a Physical file in SQPRPGLE program which makes use of cursor (Declare, Open, fetch and close) to fetch records. Records which gets skipped were actually locked by some other batch process/programs to update them. (at that time)

    When I checked the joblog, it doesn't even have an entry for missing records or it doesn't even say that record is locked or not. It simply skips the record and doesn't capture it.

    How do I make sure that records are not missed out? (I have tried compilation parameters as *CHG or *NONE), also changed cursor with 'For Read Only' and it didn't help.

    Can someone help me to overcome this issue?

  • #2
    Re: Records not fetched in SQLRPGLE

    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
      Re: Records not fetched in SQLRPGLE

      It seems the records are locked under commitment control and cannot be displayed before they are released.

      Birgitta

      Comment


      • #4
        Re: Records not fetched in SQLRPGLE

        Yes. the other job which locks this record is under commitment control and only when the updates are done, it releases the lock on it.

        Is there any way just to read the locked record using SQLRPGLE program and atleast if it gives record lock error or throws any exception, then we can handle it.

        In that case, do I need to convert the SQL statement into Chain/Read operation on file and look for record lock status 1218 and capture the exception and read the record when lock is released?

        Please let me know.

        Comment


        • #5
          Re: Records not fetched in SQLRPGLE

          Code:
          select *
          from table
          for Read Only With UR

          Comment


          • #6
            Re: Records not fetched in SQLRPGLE

            Hi surisimha:

            Probably not a fit ... but .... consider allocating the file

            Best of Luck
            GLS
            The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

            Comment

            Working...
            X