Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sequence when datafile column is NULL
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