Count rows of record inserted [message #154488] |
Mon, 09 January 2006 00:05 |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
I have create a form with several text field in tabular form. The form doesn't bind with database table.
How to count total rows of records inserted inside the fields?
Thanks.
|
|
|
|
Re: Count rows of record inserted [message #154493 is a reply to message #154492] |
Mon, 09 January 2006 00:56 |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
Thanks.
If I want to copy these inserted records to the fields in other data block, can you suggest me some useful ways? I don't have idea on how to do it.
Can use cursor to do it? But normally I use cursor to get data from table and not form...
|
|
|
|
Re: Count rows of record inserted [message #154502 is a reply to message #154497] |
Mon, 09 January 2006 01:52 |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
This is what I done but seem very confusing...
There is one row of record in blockA, when insert several new records in blockB, it will delete that record in blockA, replaced with records from blockB.
But sum of total in blockB cannot exceed blockA.
please give some suggestion...
-------------------------------------------------
declare
total number;
total2 number;
begin
go_block('blockB');
first_record;
go_block('blockA');
--total := :blockA.total;
delete_record; --delete the existing record in blockA to insert new record copy from blockB
create_record;
:blockA.material := :blockB.material;
:blockA.qty := :blockB.qty;
:blockA.total := :blockB.total;
--total2 := :blockB.total;
loop
go_block('blockB');
next_record;
exit when blockB.material is null;
go_block('blockA');
create_record;
:blockA.material := :blockB.material;
:blockA.qty := :blockB.qty;
:blockA.total := :blockB.total;
--total2 := total2 + :blockB.total;
end loop;
go_item('blockA.material');
end;
|
|
|