auto_line_numbering_mechanism [message #596224] |
Thu, 19 September 2013 03:04 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
m_shehpar
Messages: 73 Registered: October 2010 Location: Pakistan
|
Member |
|
|
Hi Everyone,
I am sorry if this is a redundant question, as i failed to find answer for this one. Actually I have designed a form. The form is like a header and Lines info thing.
At line level, if user deletes a line it actually gets cancelled and only its visibility is controlled not to show up. Now I need a column of "Line Number". The line number is obviously supposed to be starting from 1 for every new header level thing and the lines cancelled should retain their line numbering i.e. they should not be disturbed in anycase. Can somebody help me how to keep it auto ?
kindly help this.
Regards
Shabir
|
|
|
|
|
Re: auto_line_numbering_mechanism [message #596230 is a reply to message #596229] |
Thu, 19 September 2013 05:08 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Why is that "line number" important? Is it because of sorting?
I'd suggest you to use an ordinary Oracle sequence (you'd enter its value within the database trigger or setting item's "Initial value" property or use WHEN-NEW-ITEM-INSTANCE trigger or ... pick one of various solutions) which would certainly maintain uniqueness and sort order. In other words, don't store 1, 2, 3, ... for every header - store sequence.nextval (which might be 1, 2, 3, ..., 1000, millions ...).
In a form (as well as a report), it is easy to display line numbers. In a form, you'd use :SYSTEM.TRIGGER_RECORD. In a report, you'd use a summary column or ROWNUM pseudocolumn or ROW_NUMBER analytic function (partitioned on header info ordered by the sequence number).
[Updated on: Thu, 19 September 2013 05:08] Report message to a moderator
|
|
|
Re: auto_line_numbering_mechanism [message #596233 is a reply to message #596230] |
Thu, 19 September 2013 05:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
m_shehpar
Messages: 73 Registered: October 2010 Location: Pakistan
|
Member |
|
|
You'd may be have an idea of "Requisitions" in ERP. I want to mimic that functionality. For uniqueness I already have a column of "ID" running on a sequence. Line Number keeps track of active and inactive records. Lines get inactive if they are rejected in a workflow hierarchy.
I already used :SYSTEM.TRIGGER_RECORD for auto line numbering and it works very well, except when inactive lines are hidden, line numbers gets affected.
Please suggest something more...
Regards
|
|
|
|