Home » Developer & Programmer » Forms » Need a unique Serial on basis of matching records values (Oracle Forms, 10g, Windows-7)
Need a unique Serial on basis of matching records values [message #632963] Mon, 09 February 2015 03:28 Go to next message
mazam
Messages: 47
Registered: October 2009
Location: Multan
Member

Dear All

Form displaying in above image was developed using Forms 10g Rel.2 on Windows-7.
This is a Matrix-style Non-Database form.
Its Columns are in a Block named Size_Info with 20 records displayed horizontally with Size prompt. Its values are like 28,29,30...
Rows and Columns are in the same block named Size_Detail.
Rows are with Cut# prompt and Cells are the columns showing values as 1,1,1...
Keeping in view the above image, can I assign a Serial Number to matching rows (matching on the basis of values pattern) in detail block?
For example Serial Number: 1 for first 3 rows, Serial Number: 2 for next 18 rows which are similar.
Be careful that one pattern (like in rows 1 to 3 may repeat after some rows with different pattern. In that case it will be assigned same Serial as in first 3 rows.

Waiting for your response, thanks.
Re: Need a unique Serial on basis of matching records values [message #632965 is a reply to message #632963] Mon, 09 February 2015 03:46 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As it is a non-database form, where do you get those values from?

What you described reminds me of RANK (or DENSE_RANK) analytic functions. Here's an example:
SQL> with test as
  2  (select 'A' let, 'Roma' nam from dual union all
  3   select 'A', 'Los Angeles'  from dual union all
  4   select 'B', 'New york'     from dual union all
  5   select 'C', 'Rio'          from dual union all
  6   select 'C', 'London'       from dual union all
  7   select 'C', 'Budapest'     from dual
  8   )
  9  select
 10    let,
 11    nam,
 12    rank() over (order by let) rnk,
 13    dense_rank() over (order by let) drnk
 14  from test
 15  order by let, nam;

L NAM                RNK       DRNK
- ----------- ---------- ----------
A Los Angeles          1          1
A Roma                 1          1
B New york             3          2
C Budapest             4          3
C London               4          3
C Rio                  4          3

6 rows selected.

SQL>

Would it do any good?
icon12.gif  Re: Need a unique Serial on basis of matching records values [message #632976 is a reply to message #632965] Mon, 09 February 2015 05:36 Go to previous messageGo to next message
mazam
Messages: 47
Registered: October 2009
Location: Multan
Member

Dear LittleFoot (but with BigImpressions Wink)

Thanks for your input, but:
First, Can I run Analytical Functions in Oracle Forms?
2nd, all columns (size & cells) appearing in this Matrix form stored as a record in database so how can I compare that which of the sizes (columns) have same cell values, means same pattern?
Re: Need a unique Serial on basis of matching records values [message #632980 is a reply to message #632976] Mon, 09 February 2015 06:13 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know, you'll have to try. That might depend on exact Forms version you use. If possible, prepare data in a view (which is a stored query in the database and it certainly CAN use analytic functions); then use a form to display those values.
Re: Need a unique Serial on basis of matching records values [message #632984 is a reply to message #632980] Mon, 09 February 2015 09:48 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
No version of Oracle Forms currently supports Analytical Functions. You would have to write your logic in the database and then call that method from your Form.

Based on the description of your form, you already manually writing data to the screen so I would recommend you look into using Analytica Functions, like LittleFoot is suggesting, in the existing code that displays your data...unless you are doing all of this in the Form. If all the code to fetch and display the data IS in your Form then you will have to push at least the data collection part to the database (view, procedure, etc).

Craig...
Re: Need a unique Serial on basis of matching records values [message #633000 is a reply to message #632984] Mon, 09 February 2015 22:20 Go to previous message
mazam
Messages: 47
Registered: October 2009
Location: Multan
Member

Thank you Craig & LittleFoot.
Let me plan n work on your ideas then I'll inform you people if anything goes wrong.
Thanks again.
Previous Topic: how to concatenate value in procedure name using parameter at runtime
Next Topic: Data saving
Goto Forum:
  


Current Time: Thu Apr 25 05:13:02 CDT 2024