I have a table with a Trigger that make a Auto_increment.
CREATE TABLE Auto ( Auto_id NUMBER(*,0), model_id NUMBER(*,0) );
--Trigger
CREATE OR REPLACE TRIGGER tr_Auto_autoident BEFORE INSERT ON Auto FOR EACH ROW BEGIN IF inserting THEN IF :NEW.Auto_id IS NULL THEN SELECT seq_auto__id.NEXTVAL INTO :NEW.Auto_id FROM dual; END IF; END IF; END; ALTER TRIGGER tr_Auto_autoident ENABLE;
I create the sequence too.
-- Sequence
CREATE SEQUENCE seq_auto__id ;
I would like to set the autoident to a fix value to start , because my table had previos values before the trigger Auto_incremente were set.
Thanks , any help is apreciated.