Ranking within a form [message #591199] |
Thu, 25 July 2013 08:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #591255 is a reply to message #591248] |
Fri, 26 July 2013 00:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 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.
|
|
|