Home » Developer & Programmer » Reports & Discoverer » tricky question regarding sequences..
tricky question regarding sequences.. [message #89132] Wed, 15 October 2003 06:39 Go to next message
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 Go to previous messageGo to next message
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.
Re: tricky question regarding sequences. [message #89339 is a reply to message #89144] Tue, 10 February 2004 18:36 Go to previous message
prashant
Messages: 122
Registered: September 2000
Senior Member
In ur select statment add one more field rownum and it will give u the sequence no need to use anything else
Previous Topic: DISPLAYING REPORT
Next Topic: Values for all the months in the report.
Goto Forum:
  


Current Time: Thu Apr 25 23:59:41 CDT 2024