Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Partial data saving from oracle non database block

IKMay 4 2016 — edited May 11 2016

hi,


i have a formĀ  for data entry,it has non database tabular block and a button to commit changes. i loop through the block, in each iteration insert query insert the block row in table, i have implemented a check after loop ends which checks total number of rows inserted in table, if the total number rows are equal to the block rows then its commited otherwise not.


Problem
Sometimes partial data is commited to table,means if the user has entered data in 10 rows,on pressing the commit button the table will contains only 4,5 or any but not 10 rows.
the code is given below

declare

v_totrows number;

begin
GO_BLOCK('NDB_BLK');

FIRST_RECORD;

REC_COUNT:=GET_BLOCK_PROPERTY('NDB_BLK',CURRENT_RECORD);

FOR i in 1..rec_count

loop

INSERT INTO tabl1 values (:txtid,:txtname,:txtaddr,:txtphone,:txttransno);

NEXT_RECORD;

END LOOP;

select count(*) into v_totrows from table1 where transaction_no=:txttransno;

if v_totrows =:txtrowcnts then
standard.commit;
end if;

end;

i am using Oracle forms and database 11gR2

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2016
Added on May 4 2016
18 comments
3,041 views