I have the following table in oracle:
host table
id_hospede
nome
login
senha
rg
cpf
telefone
sequence:
create sequence seq_hospede_1
start with 1
increment by 1
maxvalue 1000
minvalue 1
nocache
cycle;
trigger:
CREATEOR REPLACE TRIGGER dept_bir
BEFORE INSERTON hospede
FOR EACH ROWBEGINSELECT dept_seq.NEXTVAL
INTO:new.id
FROM dual;
END;
I just can not create the trigger. The sequence is already created. How do I create the trigger related to id_hospede
to increment at time of insert
?