Home » Developer & Programmer » Forms » Ranking within a form
Ranking within a form [message #591199] Thu, 25 July 2013 08:18 Go to next message
cornwall
Messages: 36
Registered: June 2009
Member
I have a query find window that allows you to search on various attributes.
Also i have a radio button within the query find that allows you to filter the results either as a single record or mulitiple records

For example consider the data below.....

Header Table
Record_Id = 1, Record_No = 'Rec1'

Lines Table
Record_Id = 1, Line_desc = 'Line1'
Record_Id = 1, Line_desc = 'Line2'
Record_Id = 1, Line_desc = 'Line3'

I have a View that joins the 2 tables together so for Record_Id = 1 the view returns 3 rows

I would like to have a query find window that allows you to search using:
Record_No
Line_Desc
and has a radio button to allow you to either show the records as a single line or as all detail lines

Therefore i would like the following selections:

1) Enter no search criteria but select Single radio option will return 1 record with default line description of Line1
2) Enter no search criteria but select Multiple radio option will return all 3 records
3) Enter Line_Desc = Line1 with Single radio option brings back one record with Line_Desc = Line1
4) Enter Line_Desc = Line2 with Single radio option brings back one record with Line_Desc = Line2
5) Enter Line_Desc = Line3 with Single radio option brings back one record with Line_Desc = Line3
6) Enter Line_Desc = Line1 with Multi radio option brings back one record with Line_Desc = Line1
7) Enter Line_Desc = Line2 with Multi radio option brings back one record with Line_Desc = Line2
7) Enter Line_Desc = Line3 with Multi radio option brings back one record with Line_Desc = Line3

I need the form to select from the view but then perform a rank after it has selected the relavant data. Then the radio button would use the ranking to select either one record or multi records.

How can i do this in Orcale forms?

[Updated on: Thu, 25 July 2013 08:19]

Report message to a moderator

Re: Ranking within a form [message #591241 is a reply to message #591199] Thu, 25 July 2013 15:50 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is kind of late over here and I can't think very well any more, but this looks like as if you'd benefit from using SET_BLOCK_PROPERTY built-in & its DEFAULT_WHERE (or ONETIME_WHERE) property which would filter data the way you want it.
Re: Ranking within a form [message #591245 is a reply to message #591241] Thu, 25 July 2013 16:45 Go to previous messageGo to next message
cornwall
Messages: 36
Registered: June 2009
Member
Hi littlefoot,
Could you explain in a bit more detail how I would do it.

Kind regards
Re: Ranking within a form [message #591248 is a reply to message #591245] Thu, 25 July 2013 16:52 Go to previous messageGo to next message
cornwall
Messages: 36
Registered: June 2009
Member
Also how would I limit the query to just bring back one row on the single row option required on the radio group
Re: Ranking within a form [message #591255 is a reply to message #591248] Fri, 26 July 2013 00:16 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Write piece of code that - depending on search criteria you entered - composes a WHERE clause. Put it into a variable. Research usage of SET_BLOCK_PROPERTY & its properties I mentioned; you'll find examples as well. Set the property and run the form.

One way to limit number of rows is to use ROWNUM, so you'd put "where rownum <= 1" into that WHERE clause.
Previous Topic: TimeoutPJC Not working when separateframe=true
Next Topic: FRM- 93652
Goto Forum:
  


Current Time: Thu Apr 25 00:16:52 CDT 2024