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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: TRIGGER QUESTION- URGENT

RE: TRIGGER QUESTION- URGENT

From: Rajeshwari R <raji_at_chennai.insyst.com>
Date: Tue, 26 Sep 2000 10:12:11 +0530
Message-Id: <10630.117835@fatcity.com>


Hi!

   Sequence cannot be assigned to the variable... It works fine in this way.

Regards,
Raji

CREATE OR REPLACE TRIGGER "DBA_LOG_USER"."TRIG_DBAS_DBA_ID" BEFORE INSERT ON "DBA_LOG_USER"."DBAS"
REFERENCING OLD AS OLD NEW AS NEW
M_DBA_ID NUMBER;
BEGIN

     SELECT SEQ_DBAS_DBA_ID.NEXTVAL INTO M_DBA_ID FROM DUAL;
     :new.DBA_ID := M_DBA_ID;

END; -----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Gunawan Yuwono
Sent: Tuesday, September 26, 2000 12:31 AM To: Multiple recipients of list ORACLE-L Subject: RE: TRIGGER QUESTION- URGENT

Try this:
CREATE OR REPLACE TRIGGER "DBA_LOG_USER"."TRIG_DBAS_DBA_ID" BEFORE INSERT ON "DBA_LOG_USER"."DBAS"
REFERENCING OLD AS OLD NEW AS NEW
BEGIN
     :new.DBA_ID := SEQ_DBAS_DBA_ID.NEXTVAL; END; HTH. Gunawan Yuwono
Oracle DBA
Kansas City, MO

>--- Original Message ---
>From: "Miller, Bryan" <MillerB_at_telergy.net>
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Date: 9/25/00 5:00:27 PM
>

>I am trying to set up a Trigger to put the NEXTVAL of a Sequence
into a
>field of a table after the other fields have been inserted with
data. The
>trigger is valid and enabled yet it does not put the NEXVAL
in the new row.
>The trigger is as follows:
>
>CREATE OR REPLACE TRIGGER "DBA_LOG_USER"."TRIG_DBAS_DBA_ID"

>AFTER INSERT ON "DBA_LOG_USER"."DBAS"
>BEGIN
> UPDATE DBAS
> SET DBA_ID = SEQ_DBAS_DBA_ID.NEXTVAL;
>END;
>
>Bryan M. Miller
>Junior Oracle DBA
>IT Operations
>Telergy Inc.
>Email: bmiller_at_telergy.net
>Phone: (315)362-2642
>Pager: (315)647-1908
>
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Miller, Bryan
> INET: MillerB_at_telergy.net
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing
Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru')
and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from).
You may
>also send the HELP command for other information (like subscribing).
>
>



Sent from a WebBox - http://www.webbox.com FREE Web based Email, Files, Bookmarks, Calendar, People and Great Ways to Share them with Others!
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Gunawan Yuwono
  INET: gunawan.yuwono_at_webbox.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Mon Sep 25 2000 - 23:42:11 CDT

Original text of this message

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