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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Help with Trigger PLS-00049

Re: Help with Trigger PLS-00049

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 24 Nov 2000 18:53:53 +0100
Message-ID: <8vmsvk$57gg3$1@ID-62141.news.dfncis.de>

Your update statement. You don't need to prefix pl/sql variables with a colon anywhere, except for columns in the current record. so use update styles set Moc001 = colorcnt where mainkey = :new.mainkey

Hth,

Sybrand Bakker, Oracle DBA

<tjmxyz_at_my-deja.com> wrote in message news:8vldmp$o2b$1_at_nnrp1.deja.com...
> Hi!
>
> I'm a little lost on this trigger...
> CREATE OR REPLACE TRIGGER packing_fdb_colcount_tomain
> BEFORE INSERT OR UPDATE ON "PACKING"
> FOR EACH ROW
> DECLARE
> ColorCnt number;
> BEGIN
> IF (INSERTING OR UPDATING) AND :new.COLOUR<>:old.COLOUR THEN
> ColorCnt := 0;
> FOR cnt IN 1..8 LOOP
> IF SUBSTR(:new.COLOUR,cnt*20-19,20) IS NULL THEN
> ColorCnt := ColorCnt+1;
> END IF;
> END LOOP;
> update styles set moc001=:ColorCnt where mainkey=:new.mainkey;
> END IF;
>
> END;
> /
>
> 11/27 PLS-00049: bad bind variable 'COLORCNT'
>
> I looked in the manual but did not see any examples of using
> variables in a trigger ....
>
> What could be wrong?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Nov 24 2000 - 11:53:53 CST

Original text of this message

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