Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Compilation Error on Trigger?
I am trying to learn Oracle 8i, installed on an NT box. I created this trigger to automatically insert a sequential value into the [newid] field in my test table "jfrotest". I first created a sequence with index of 1 named as "jfrotest_seq" and then wrote the following trigger:
create or replace trigger jfro.jfrotest_BI
before insert on jfro.jfrotest
for each row
declare next_num NUMBER;
begin
select jfro.jfrotest_seq.next_val
into next_num from dual;
:new.newid := next_num;
end;
From SQL *Plus, I type this in then hit "/" to compile and run it. All I get
is :
"Warning : Trigger created with compilation errors"
The trigger won't work as it causes an error when I now try to insert. How can I tell what exactly is wrong with this trigger code? What is it trying to tell me is the "compilation error"?
Thanks in advance for any help/ideas! jf
![]() |
![]() |