If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > sequence + trigger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-04, 04:55
vzse vzse is offline
Registered User
 
Join Date: Sep 2004
Posts: 1
sequence + trigger

Hi,

I'm trying to create an auto-increment column in a table using a sequence.
The problem is that I can't create a trigger that would set the new.auto_id column to my_sequence.nextval.
In other words i'd like to translate the following Oracle trigger to an Informix one:

create or replace trigger my_trigger before insert on my_table for each row
BEGIN
SELECT my_sequence.nextval INTO :new.auto_id FROM dual;
END;

Has anyone faced the same problem?

Thx
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On