This content has been marked as final. Show 8 replies
Sequence you can create in database and you can use that sequence in forms for generation sequence number
For creation see the below link...
For generating numbers in forms use like this...
For each entry at the time of save you can use on PRE-INSERT of block level SELECT SEQUENCE_NAME.NEXTVAL INTO :FORM_FIELD_NAME FROM DUAL;
You can create a sequence using
create sequence <sequencename> start with <your_number>
and <sequencename>.nextval will give the values.
Use it in form to provide unique values
Hope it helps
Hi,1 person found this helpful
Create sequence <sequence_name>
Start with <number>
increment by <number>
eg:- create sequence test_seq
start with 1
increment by 1;
you can assign value in pre-insert trigger
cursor cur_seq is
select test_seq.nextval from dual;
fetch cur_seq into :item_key ; /* :item_key give name of ur primary key field*/
When i press the button i didnt get the initial number 1
I have created a pre-insert trigger in my block level and use the select statement with my text field name but i didnt get it.
How did you create the sequence can we see that statement?
Did you create the sequence in same user which you are using in forms?
Can we see the code you used in pre-insert?
Seq creation in database
Create sequence leave_entry
stat with 1
increment by 1
max value 99999;
And My block named Leave_data_entry
In that i have created a pre-insert trigger
And I have used the select statement u have mentioned
INTO :slno FROM DUAL;
Is it to create a procedure to insert the seq value
Thanks In Advance
That was just example for sequence_name you will have to use actual sequence name...1 person found this helpful
Use this in pre-insert
SELECT LEAVE_ENTRY.NEXTVAL INTO :slno FROM DUAL;
you have created leave_entry sequence1 person found this helpful
and you are using sequence_name in select statement
then how will you get the value from leave_entry sequence