serial field [message #294819] |
Sat, 19 January 2008 09:36  |
akramrabaya
Messages: 41 Registered: November 2007
|
Member |
|
|
i have a data block based on a database table " invoice " with
the following fileds (ser_no,item_code,qty,unit_price,total)
i want fileld ser_no to be generated automatically when ever i
insert any new record on that block
example
ser_no item_code qty unit_price total
1 , A/251 , 20 , 5 , 100
2 , b/251 , 10 , 10 , 100
so if i insert any new record between these 2 recored i want
the ser_no field to be adjusted automatically like this
ser_no item_code qty unit_price total
1 , A/251 , 20 , 5 , 100
2 , d/251 , 1 , 15 , 15
3 , b/251 , 10 , 10 , 100
best regards and thanks in advance
akram
|
|
|
|
|
Re: serial field [message #294841 is a reply to message #294839] |
Sun, 20 January 2008 00:15   |
akramrabaya
Messages: 41 Registered: November 2007
|
Member |
|
|
sorry
i didn't answer the second part
:SYSTEM.CURSOR_RECORD or :SYSTEM.TRIGGER_RECORD is help but what i want is to adjust the whole block record not only the current record
1
2
3
4
5
if i delete the record no. 2 the ser_no filed become like this
1
3
4
5
!!! but i want it to be adjusted automatically to
1
2
3
4
thanks in advance
akram
|
|
|
|
Re: serial field [message #295280 is a reply to message #295238] |
Mon, 21 January 2008 23:55   |
akramrabaya
Messages: 41 Registered: November 2007
|
Member |
|
|
ok i need that field cuz i may use the same item_code more than
one time on the same invoice .. so it will not be enouph to use the item code only to access this record .. so i thought to have a ser_no field which will be always unique on the same invoice
akram
|
|
|
|
Re: serial field [message #295596 is a reply to message #295280] |
Tue, 22 January 2008 19:17  |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Use a sequence to make it unique in the database and use 'rownum' to make it LOOK unique when you display or print it.
David
|
|
|