Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sequence numbers URGENT!!!!!!!!!!

Status
Not open for further replies.

zapata

IS-IT--Management
Jan 20, 2003
16
NL
I created a sequence on my database table.
I was only going to implement the sequence on form level.
However, any time I try to insert records, the form gives an error that em_id (which is the sequence id) cannot be null.
Once you enter a value, it says that unique constraint has been violated.
My form is designed to accept duplicates.
How do I resolve this?
Please help urgently!!
thank you
 
Ok, good friends,
I am proud to say that I have resolved this on my own.
Here is the code in case anyone needs it in the future:

declare
next_seq number;
begin
select max(Emp_id)into next_seq from yourDBtable;
next_seq := next_seq + 1;
:Emp_seq_no := next_seq;
insert_record;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top