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: Sequence when datafile column is NULL

Re: Sequence when datafile column is NULL

From: vijay <vijay_at_prodigy.net>
Date: 1997/03/02
Message-ID: <331A5B9A.6C17@prodigy.net>#1/1

You are basically inserting null values to the not null column through your database trigger. Your database trigger should look like

create or replace trigger atable_trigger BEFORE insert or update on atable
for each row
begin

    :new.col1 := UPPER(:new.col1);
    :new.col2 := UPPER(:new.col2);
    if inserting then

        select atable_seq.NextVal into :new.col3;     end if;
end;

Gary M. Greenberg wrote:
>
> Hi y'all. I have a SQL script such as:
>
> drop table atable;
> drop sequence atable_seq increment by 1 start with 1;
> create table atable (
> col1 char(1) NOT NULL,
> col2 char(1) NOT NULL,
> col3 number(3) )
> tablespace atablespace;
  Received on Sun Mar 02 1997 - 00:00:00 CST

Original text of this message

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