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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AUTO-INC - TRIGGER Did you know another way to do it?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here the SQL for creating an AUTO-INC (increment id) trigger, enjoy it:

create generator gen_yourtable;

set term !!;
create trigger yourtable_bi for yourtable active before insert position 0 as
begin
if (new.id is null) then new.id=gen_id(gen_yourtable,1);
end !!
set term; !!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top