Home » Developer & Programmer » Forms » working with sequence in forms (oracle 10g)
working with sequence in forms [message #575728] Sat, 26 January 2013 01:56 Go to next message
furqan
Messages: 112
Registered: January 2012
Location: Hyderabad
Senior Member
CREATE SEQUENCE hyd1_seq
START WITH 2100000
INCREMENT BY 1
NOCACHE
NOCYCLE;

this is how i created a sequence in database 10g.

if :SHIP_MSTR.PLACE_FROM = 'hyd1' then
SELECT hyd1_seq.NEXTVAL
INTO :SHIP_MSTR.BILL_ID
FROM dual;

this is how iam calling sequence in form.

my problem is once the sequence is generated in form and even if i am not saving a form
its generating next value next time.what i want to do is if i am not saving the form
that sequence number should again come in bill_id.

Thanks in advance for your help.
regards
Re: working with sequence in forms [message #575729 is a reply to message #575728] Sat, 26 January 2013 02:00 Go to previous messageGo to next message
Michel Cadot
Messages: 58635
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ Do not use NOCACHE
2/ I don't know Forms but in any language you can set a flag so that you know if you have to call NEXTVAL or CURRVAL

Anyway, it does not matter if you have a new number or not as a sequence number is meaningless it is just there to give you a unique number. You can avoid some numbers are lost.

Regards
Michel
Re: working with sequence in forms [message #575731 is a reply to message #575729] Sat, 26 January 2013 02:14 Go to previous messageGo to next message
furqan
Messages: 112
Registered: January 2012
Location: Hyderabad
Senior Member
thanks for your reply.

ok will not use no cache but how to avoid loss of sequence
if the form is not saved.

thanks
Re: working with sequence in forms [message #575733 is a reply to message #575731] Sat, 26 January 2013 03:29 Go to previous message
Michel Cadot
Messages: 58635
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You cannot avoid loss of numbers.
Imagine 2 sessions, one takes a number, the other (and subsequent) one takes the next number, the first one does not save, so its number is lost.
Loss of numbers is inherent to multi-session.

Regards
Michel

[Updated on: Sat, 26 January 2013 03:30]

Report message to a moderator

Previous Topic: upload a PDF file
Next Topic: menu module
Goto Forum:
  


Current Time: Thu Jul 31 13:54:35 CDT 2014

Total time taken to generate the page: 0.07287 seconds