ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Can you update data within a subfile result set?

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

  • Can you update data within a subfile result set?

    I am using a scrollable SQL cursor to fill and manipulate a subfile. The user can make changes to the data within the subfile using options and program calls etc. Is there a way to update the data in my result set? Now that I have the scrollable cursor doing what I need it to do (paging up and down and repositioning correctly) I do not want to close and open the cursor again.

    I know this may be a shot in the dark....but I figured there is never a stupid question.

    Karen
    Attached Files

  • #2
    I know of no way to update a row without issuing an UPDATE command to the database manager.

    Sometimes you can link tables to other software, such as Microsoft Access, and any changes you make to the data grid get pushed to the database. In such cases, the application is sending UPDATE's to the DBMS and you never see it happening.

    Comment


    • #3
      Well....poop....I thought that's what someone might tell me.

      Comment


      • #4
        To ask a stupid question - you've loaded the subfile with your result set, the user changed the data - if you issue an UPDATE to update the changes - you have the changes in your subfile... exactly what's missing?

        Comment


        • #5
          Well I've updated the data in the file but I have not rerun the SQL to re-retrieve that data. I am just working thru the existing result set. If I close and reopen the cursor, my updates are again visible. Ideally I wanted to be able to come back from the program call that updated the data and position the cursor in the subfile to that record for display on the screen.

          Comment


          • #6
            Ok - but again - you have the updated data already in your program that you'd use in an SQL update... you can redisplay your subfile anyway you'd like... unless you're only building the current page of the subfile rather than adding to it as you go... I can see where you may want to refresh your return set in that situation....

            Comment

            Working...
            X