Auti increamnet using seq. in form level [message #493016] |
Fri, 04 February 2011 05:25 |
swapnil_naik
Messages: 269 Registered: December 2009 Location: Mumbai
|
Senior Member |
|
|
Hi friend i created a simple seq. for auto-increamenting empno.
Code for sequence :
--------------------------
create sequence seq_empno
start with 8000
MAXVALUE 9000
INCREMENT by 1
nocache
nocycle
==========================================================
I created a form (herewith attached form),
my problem will arise supposed i pressed add button every time my seq. generated....but still i didnt press save button
Now scenario like this
1) prees add button
2) empno now become 8001
3) i neither enter any thing nor press SAVE button.
4) i press exit button
5) when i next time press add button same no ( 8001) will be generated again.
6) if this time i preess save button then empno would become 8002 on next time
I hope all of us undesrstand my scenarion
please helpp me
|
|
|
|
|
|
Re: Auti increamnet using seq. in form level [message #493048 is a reply to message #493038] |
Fri, 04 February 2011 07:04 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Won't make much difference. You'd still need to lock the table before doing the insert.
Plus if you do something that causes the record to be posted and not committed you could be holding onto that lock for a long time.
If you want a detailed discussion on the cons search on asktom for gapfree sequence.
|
|
|