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!

Get the Count of records

user8833410Sep 13 2011 — edited Sep 14 2011
Hi All,

In my form i have a block with some 4 fields like this given below For example number of records = 1000

name-------value---------qty--Flag
name-------value---------qty--Flag
name-------value---------qty--Flag
name-------value---------qty--Flag
name-------value---------qty--Flag

once i open the form and based on some validation i will populate data to my block, after user may select any record with check box(Flag).

My question is If user clicks any record sytem should display the count of records he selected should show in the form. I did this with the following code:

declare
ln_cnt number;
ln_rec number:=0;
begin
go_block('b1')
last_record;
ln_cnt := :system.cursor_record;
first_record;
for i in 1..ln_cnt
loop
if flag = 'Y' then
ln_rec := ln_rec + 1;
end if;
if ( i = ln_cnt) then
exit;
else
next_record;
end loop;
end;
mesg('NO of records'||ln_rec);

this is working fine but it is taking too much time , because each click of check box whether tick/un tick system will process this code so more time will be consuming.

please suggest any other solution.

Thanks in advance

GV
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2011
Added on Sep 13 2011
4 comments
1,924 views