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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with trigger compilation errors

Re: Help with trigger compilation errors

From: Alexander I. Doroshko <aid_at_grant.kharkov.ua>
Date: 7 Apr 1999 18:49:12 GMT
Message-ID: <01be8127$417d7040$190114c1@sister.grant.UUCP>


tim.mcconechy_at_runtime.dk wrote in article <7ed3i4$t7c$1_at_nnrp1.dejanews.com>...
: This code usually works fine: CREATE OR REPLACE TRIGGER
pdmlog_audit_info
: BEFORE INSERT OR UPDATE ON "PDMLOG" FOR EACH ROW BEGIN IF
INSERTING THEN
: :new.user_name := user; :new.lastedit := sysdate; ELSIF UPDATING
THEN
: :new.user_name := user; :new.lastedit := sysdate; END IF; END; /
ERROR at
: line 2: ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553:
: PLS-320: the declaration of the type of this expression is incomplete
or
: malformed

:

: Here is the code to duplicate the problem.
: CREATE TABLE "PDMLOG" (

 <skipped>
: "DATE" date NOT NULL,
   ^^^^^

 <skipped>
: "USER_NAME" number(2) NULL,
: "LASTEDIT" varchar2(20) NULL
: )

 <skipped>

IMHO, one mustn't use Oracle reserved words for any own purposes. Truly speaking, the PL/SQL reaction for this seems a bit weird, but c'est la vie - rename column
DATA, and the mistake'll disappear.
You use other reserved words - TYPE and USER for column names, it can cause somewhere something sometimes too. And USER function returns VARCHAR2, and the column USER_NAME is number(2). The trigger in any case can't outlive more than 100 users, speaking nothing of DBA who gives users the names his left heel wants. Received on Wed Apr 07 1999 - 13:49:12 CDT

Original text of this message

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