Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Problem
You could make the trigger shorter.
CREATE OR REPLACE TRIGGER TRI1 BEFORE INSERT
ON SOBSBGI FOR EACH ROW
BEGIN
SELECT GTVZIPC_STAT_CODE INTO :NEW.SOBSBGI_STAT_CODE FROM
SATURN.GTVZIPC
WHERE GTVZIPC_CODE = :NEW.SOBSBGI_ZIP;
END;
As the person defining the trigger in sqlplus type
desc SATURN.GTVZIPC
then
desc SOBSBGI
What results do you get back (either with your code or mine, doesn't matter) Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Mohammad" <mhakimjavadi_at_hotmail.com> wrote in message news:cc59b627.0306110752.11625485_at_posting.google.com...Received on Thu Jun 12 2003 - 09:00:47 CDT
> Hi Everybody,
> I try to create a Trigger but I got this following error :
>
> Warning: Trigger created with compilation errors.
>
> SQL> SHOW ERROR
> Errors for TRIGGER TRI1:
> 6/3 PL/SQL: SQL Statement ignored
> 6/50 PL/SQL: ORA-00942: table or view does not exist
>
> I dont know what is meaning of this error because the table exists.
>
> Here it is my code:
>
> SQL> CREATE OR REPLACE TRIGGER TRI1 BEFORE INSERT
> 2 ON SOBSBGI FOR EACH ROW
> 3 DECLARE
> 4 STAT VARCHAR(3);
> 5 ZIPC VARCHAR(10);
> 6 BEGIN
> 7 ZIPC := :NEW.SOBSBGI_ZIP;
> 8 SELECT GTVZIPC_STAT_CODE INTO STAT FROM SATURN.GTVZIPC
> 9 WHERE GTVZIPC_CODE = ZIPC;
> 10 :NEW.SOBSBGI_STAT_CODE := STAT;
> 11 END;
>
>
> Please help me and tell me what is the problem.
>
> Thanks
> Hakim
![]() |
![]() |