Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-06552 while creating a trigger

Re: ORA-06552 while creating a trigger

From: <fitzjarrell_at_cox.net>
Date: 27 Mar 2005 06:03:35 -0800
Message-ID: <1111932215.237850.163650@f14g2000cwb.googlegroups.com>

Golan wrote:
> "Arun Mathur" <themathurs_at_gmail.com> wrote in message
news:<1111682766.848739.5670_at_o13g2000cwo.googlegroups.com>...
> > What version are you running? This worked fine on my development
> > instance. See below:
> >
> > SQL> conn amathur_at_dbdev
> > Enter password:
> > Connected.
> > SQL> select * from v$version;
> >
> > BANNER
> > ----------------------------------------------------------------
> > Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
> > PL/SQL Release 9.2.0.1.0 - Production
> > CORE 9.2.0.1.0 Production
> > TNS for Solaris: Version 9.2.0.1.0 - Production
> > NLSRTL Version 9.2.0.1.0 - Production
> >
> > SQL> create table test1(a number(3),b timestamp);
> >
> > Table created.
> >
> > SQL> create trigger aaa
> > 2 before insert on test1
> > 3 referencing new as new
> > 4 old as old
> > 5 for each row
> > 6 begin
> > 7 null;
> > 8 end;
> > 9 /
> >
> > Trigger created.
>
>
> Thanks Arun.
> I've tried it again and I was supprised to find out that it's
working.
> After more investigations I found out that the problem occur when you
> have a combination of timestamp type field and a timestamp field name
> ( When I first posted the message, I've changed the names since I
> didn't think that this is the problem).
> For example try:
> create table TEST1 (
> Event_Timestamp Timestamp,
> Timestamp Date);
> CREATE OR REPLACE TRIGGER AAA
> BEFORE INSERT
> ON test1
> REFERENCING NEW AS NEW OLD AS OLD
> FOR EACH ROW
> Begin
> null;
> End;
> /
>
> and I guess you'll get the problem.
> Anyway, I will change the field name in order to avoid the problem.
>
> Thanks again for your help

This, of course, proves why reserved words should not be used as column and/or table names. Why on earth you'd choose to name a column after a valid datatype is beyond my understanding. And, possibly, you should have posted the ORIGINAL code you atempted to use which produced the error, instead of code you modified, yet did not test, which proved to be error-free.

David Fitzjarrell Received on Sun Mar 27 2005 - 08:03:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US