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 -> What's wrong with this SQL statement?

What's wrong with this SQL statement?

From: Troy Perchotte <max_at_headroom.com>
Date: Thu, 18 Jun 1998 17:33:40 -0700
Message-ID: <3589B1E4.B95806E5@headroom.com>


I would like to have oracle update the item_id field (kind of like the counter field in ms-access) whenever a new record is created. But when I try to create my trigger to do this, I receive the following error:

"ora6552: compilation unit analysis terminated"
"ora6553: pls:320: the declaration of the type of this expression"

I have created a sequence called: inv_field_items_sequence

CREATE OR REPLACE TRIGGER "DCI".INV_FIELD_ITEMS_TRIGGER AFTER INSERT ON
"DCI"."INV_FIELD_ITEMS" for each row

begin

   update dci.inv_field_items
   set dci.inv_field_items.item_id=dci.inv_field_items_sequence.nextval    where dci.inv_field_items.item_id = :NEW.item_id end;

Any idea on what I am do missing or doing wrong?

Troy Perchotte Received on Thu Jun 18 1998 - 19:33:40 CDT

Original text of this message

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