tricky question regarding sequences.. [message #89132] |
Wed, 15 October 2003 06:39 |
dandu ravi
Messages: 5 Registered: August 2003
|
Junior Member |
|
|
i create a sequence
ex: create sequence rr start with 1;
now i use this sequence in my reprts for the running serial number
as rr.nextval into a from dual;
here a is the field which gives the random sequence number.
first when i run the report a list of values as 1,2,3,4,.. gets inserted into the serial number column.
when i exit and run the file the number starts inserting from 5..
but i want the values again from 1 ..pls tell me how can i do it..
|
|
|
Re: tricky question regarding sequences.. [message #89144 is a reply to message #89132] |
Thu, 16 October 2003 05:38 |
Bhavin Mehta
Messages: 18 Registered: October 2003
|
Junior Member |
|
|
Sequence is an object whose value will be increased whenever you reference it by .NEXTVAL. This incremented value will be stored in the database and whenever you/ any other user tries to access the same, you/he will get an incremented value.
In your case, it seems a PL/SQL variable initialized with 1 and increamented by 1 after every INSERT statement will be sufficient. No need to use sequence if the value is not a primary key.
|
|
|
|