Home » Developer & Programmer » Forms » Displaying total number of distinct records in forms 10g datablock (Oracle 10g Forms Windows)
Displaying total number of distinct records in forms 10g datablock [message #408443] Tue, 16 June 2009 04:30 Go to next message
helloafzaal
Messages: 20
Registered: February 2009
Location: Dubai,UAE
Junior Member

Hi All,

I have one datablock displaying multiple records and i have two summary items Current_record and Total_record at the end of block to display total number of records.

Suppose there are total 10 records and i have select third records in displyed datablock in current_record there should be value 3 and in total_record
there should be value 10.

For total_records i have achieved functionality by
get_block_property('block Name', query_hits)

and for current_record i have achieved this by :system.cursor_record;
But i have one problem that my data is duplicate
suppose there are 5 records in department 10 i want only count=1 for these 5 records because these all represent to one department.

when i click at any records of block current_record field should also be populated according to distinct record count but presently i am getting it only as per total number of records displayed without considering the distinct records.


can any one help me on this?

Best Regards,
Muhammad Afzaal.







Re: Displaying total number of distinct records in forms 10g datablock [message #408454 is a reply to message #408443] Tue, 16 June 2009 05:04 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that you'll have to (manually) find number of records you are interested in, such as
select count(*) -- or perhaps count(distinct ...)
  into :block.number_of_records
  from some_table
  where id = :block.some_id
...
Re: Displaying total number of distinct records in forms 10g datablock [message #409483 is a reply to message #408443] Mon, 22 June 2009 20:32 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Look at 'count_query', either in this forum, the reference manual, or the Forms Builder help facility.

David
Re: Displaying total number of distinct records in forms 10g datablock [message #409544 is a reply to message #409483] Tue, 23 June 2009 01:35 Go to previous message
helloafzaal
Messages: 20
Registered: February 2009
Location: Dubai,UAE
Junior Member


Thanks a lot for your replies on the above in the meanwhile i found one solution for this

For total number of distinct record i have used:-
" count( distinct my_column) over ()"

and for distinct current selected record i have used:-

dense_RANK () OVER (ORDER BY my_column) rec_number,

By this way i have achieved my required functionalities.

once again thanks a lot for your replies are support.

bests
Muhammad Afzaal.
Previous Topic: run report in Web Layout from Forms
Next Topic: how to hide the default status bar (message bar)
Goto Forum:
  


Current Time: Sat Dec 03 09:54:02 CST 2016

Total time taken to generate the page: 0.21464 seconds