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