Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Data written into DB table without COMMIT WORK

former_member343107
Participant
0 Kudos

Dear all,

I wrote a simple program to test the data update:

DATA: line TYPE ZDATA,

flag TYPE I VALUE 1.

line-data1 = '1'.

line-data2 = 'abc'.

INSERT INTO zdata VALUES line.

WHILE flag EQ 1.

flag = 1.

ENDWHILE.

COMMIT WORK.

After the program enters the endless loop, I checked the DB table content and found the data "1" and "abc" has already been written into the table. But here the COMMIT WORK statement has not been executed yet. Can anybody clarify this issue?

Thanks + Best Regards

Jerome

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, this is how the system works, the data is temporary written to the table during program execution, but say you put a breakpoint in the program at the endless loop, and then exit the program without it completing normal, the line in the table will be removed automatically, because a) the commit work has not been executed and/or b) the program did not end normally(because you ended while in debug) Make sense?

REgards,

Rich Heilman

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, this is how the system works, the data is temporary written to the table during program execution, but say you put a breakpoint in the program at the endless loop, and then exit the program without it completing normal, the line in the table will be removed automatically, because a) the commit work has not been executed and/or b) the program did not end normally(because you ended while in debug) Make sense?

REgards,

Rich Heilman

0 Kudos

Thanks a lot for the explanation!

Best Regards

Jerome