Home » Developer & Programmer » Forms » resetting serial number (Windows XP Oracle Forms 6i,)
resetting serial number [message #317067] Tue, 29 April 2008 06:59 Go to next message
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
I have one column SL_No i have created sequence and its working fine starts from so n so

whenever im inserting record in a new form the sequence will start fromt he next number example 5.6.7.

i want this sequence will restart from everytime when new record instance.

how can i do this?

Re: resetting serial number [message #317074 is a reply to message #317067] Tue, 29 April 2008 07:15 Go to previous messageGo to next message
Messages: 21148
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
i have created sequence

Do you mean an Oracle object? (created by CREATE SEQUENCE ...)? If so, hm, that's not a very good idea. Because, you might alter sequence (or even drop and create, with certain drawbacks) to start from 1 again but - that would work for a single user. What would you do in multi-user environment? Users would alter this sequence one after another and it would be a complete mess.

I'd suggest you to abandon this approach and use :SYSTEM.TRIGGER_RECORD instead; it might do what you are looking for.
Re: resetting serial number [message #317190 is a reply to message #317067] Tue, 29 April 2008 20:41 Go to previous message
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you considered using the block property 'current_record' in the block level 'pre-insert' trigger to populate 'sno' when the user saves their data. What do you want to do with the value in 'sno' when the user updates a set of records and inserts one in the middle?

Previous Topic: Multilingual Form
Next Topic: FILE_OPEN_DIALOG question
Goto Forum:

Current Time: Tue Aug 22 23:34:52 CDT 2017

Total time taken to generate the page: 0.05249 seconds