2
I have the following table in oracle:
table guest
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’t create Trigger. The sequence is already created. How I create Trigger related to the id_hospede
to increase at the time of insert
?
i just don’t know how I refer the id_hospede to make the auto increement at the time of the Insert.
– André Nascimento
In the first example I gave, no references to column: Insert into identity_test_tab(Description) values('test');
– Renato Afonso
Sorry, I forgot to mention the excerpt. I’m talking about the setundo excerpt of your answer, which speaks of nextval. Puts a full example of the insertion in the id_hospede, name, for example.
– André Nascimento