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

Home -> Community -> Usenet -> c.d.o.server -> Re: Instead of triggers on Oracle Personal 8.0.4

Re: Instead of triggers on Oracle Personal 8.0.4

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 18 Nov 1998 22:38:41 GMT
Message-ID: <365a4bf6.34226304@192.86.155.100>


A copy of this was sent to arivlin_at_altera.com (if that email address didn't require changing) On Wed, 18 Nov 1998 18:33:31 GMT, you wrote:

>I got an error message ORA-00439( feature not enabled ) when I tried to create
>an instead of trigger on Oracle Personal 8.0.4 ( NT4.0 )
>Does anyone know if there is a way around it?
>
>I would also appreciate any suggestion how to force a column in a table to be
>always set to sequence.nextval and prevent any kind of SQL+ intervention?
>

well, to do what you want to do you would not use an instead of trigger, rather it would look like:

create trigger tib_definition
before insert on defintion for each row begin

   select seq_definition.nextval into :new.definition_seqnum from dual; end;

Instead of triggers are for views (instead of inserting into this VIEW, do this ....).

Also, i believe instead of triggers require Oracle8 EE..

>here is what I am doing:
>create table Definition ( Definition_SeqNum number (5) NOT NULL,
> Definition_Name varchar (20) NOT NULL,
> Definition_Type varchar2 (250) NOT NULL,
> Definition_Value number ( 10 ) NULL )
>/
>drop sequence Seq_Definition
>/
>create sequence seq_Definition increment by 1 start with 1 nomaxvalue
>nocycle
>/
>
>create or replace trigger tIB_Definition
>instead of insert on Definition
>for each row
>begin
> begin
> insert Definition ( Definition_SeqNum,
> Definition_Type,
> Definition_Name,
> Definition_Value )
> values ( seq_Definition.nextval,
> :new.Definition_Type,
> :new.Definition_Name,
> :new.Definition_Value )
>
>
> end;
>
>end;
>/
>show errors
>
>
>Please help.
>Alex
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Nov 18 1998 - 16:38:41 CST

Original text of this message

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