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

Sequence when datafile column is NULL

From: Gary M. Greenberg <garyg_at_southeast.net>
Date: 1997/02/27
Message-ID: <garyg-ya02408000R2702971736340001@news.southeast.net>#1/1

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;
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

        insert into atable(col3)
        values(atable_seq.NextVal);

    end if;
end;

I have this in a the control file:

OPTIONS ( DISCARDMAX=0,ERRORS=0 )
LOAD DATA
INFILE 'atable.dat'
STREAM
REPLACE
INTO TABLE atable
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
col1 char,
col2 char,
col3 char)

And, atable.dat looks like this:

a,b,
a,c,
a,d

sqlload user/passwd control=atable gives me an error. The error I'm getting is that a contraint on a NOT NULL value is wrong for the trigger. What's wrong with my script and/or control file? It is not a permission problem; I have full authority.

Replies by email and/or post at your option. Thanks,

gary         -=- visit The C Programmers' Reference -=-
          http://users.southeast.net/~garyg/C_ref/C/c.html
               The AVENUE Programmers' Class Requests
             http://users.southeast.net/~garyg/class.htm
Received on Thu Feb 27 1997 - 00:00:00 CST

Original text of this message

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