Using multiple sequences in trigger to generate unique identity : <p>I am entering rows to my equipment table and if it is an antenna, I want to add prefix 'A' for antenna(antennas have foot number 1 to 4) and this prefix has a sequence for numbering.
Also if it is not an antenna, it will take foot number -1 and have a prefix starts with 'E' for equipments. </p>

<p>*Using ORACLE db.</p>

<pre><code>CREATE OR REPLACE TRIGGER AFM.INV_SEQ_EQ_TOY_T
BEFORE INSERT ON AFM.EQ
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
WHEN (new.antenna_foot_number in (-1,1,2,3,4))
BEGIN
    IF :new.antenna_foot_number = -1 THEN
        :new.eq_id := 'E'|| INV_SEQ_EQ_TOY.nextval;
    else :new.eq_id := 'A'|| INV_SEQ_EQ_ANTENNA_TOY.nextval;
    END IF;
END;
</code></pre>
