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: simple trigger question

Re: simple trigger question

From: Lun Wing San (Oracle) <wslun_at_qrcsun.qrc.org>
Date: 1997/02/01
Message-ID: <32F3859C.2FA0@qrcsun.qrc.org>#1/1

John Holland wrote:
>
> I'm trying to create a simple trigger. I get a warning: trigger created
> with compilation errors message. When I say show errors it says NO ERRORS.
>
> the code is as follows:
> create or replace trigger itemcalc
> after insert or update of quantity on items
> for each row
> declare
> itemprice real;
> begin
> select unitcost into itemprice from parts
> where partnumb = :new.partnumb;
> :new.total = :new.quantity * itemprice;
> end itemcalc;
> /

  Try :

  create or replace trigger itemcalc
  after insert or update of quantity on items   for each row

  declare

          itemprice real;
  begin

	  select unitcost into itemprice from parts
	  where partnumb = :new.partnumb;
 	 :new.total = :new.quantity * itemprice;
  end;
  /

  Moreover, please check the status of the itemcalc after creating the trigger to ensure it is valid or not or.

---
Name   : Lun Wing San
Title  : Oracle Application Developer of Hong Kong Productivity Council
         Oracle Database Administrator and System Administrator of QRC
Phone  : (852)27885841
Received on Sat Feb 01 1997 - 00:00:00 CST

Original text of this message

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