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: I'm going crazy - Sequence, insert problem

Re: I'm going crazy - Sequence, insert problem

From: Thomas Gaines <Thomas.Gaines_at_noaa.gov>
Date: Wed, 09 Oct 2002 15:59:36 -0600
Message-ID: <3DA4A6C8.3017CE4C@noaa.gov>


It appears to me that you have a trigger on source.desctable that does an insert into source.HET_SOURCE_FOODS whenever it sees an insert. Check your dba_triggers dictionary table.

TG

steve deno wrote:

> I am just trying to do the following:
>
> declare a number;
> begin
> SELECT source.het_source_food_id_seq.nextval
> INTO
> a
> FROM dual;
> dbms_output.put_line(a);
>
> INSERT INTO source.desctable
> (het_source_food_id,
> description,
> desc_2,
> f_name,
> prep_type,
> brand_id,
> category_id,
> serving_desc,
> portion_id,
> gram_weight,
> date_created,
> date_modified,
> modified_by,
> created_by )
> VALUES
> (a,
> '1',
> 'sss',
> 'sss',
> '1',
> 1,
> 1,
> '1',
> 1,
> 2,
> sysdate,
> sysdate,
> user,
> user );
> end;
>
> I get the following output:
>
> 2999
> declare a number;
> *
> ERROR at line 1:
> ORA-01400: cannot insert NULL into
> ("SOURCE"."HET_SOURCE_FOODS"."HET_SOURCE_FOOD_ID")
> ORA-06512: at line 5
>
> SQL> /
> 3000
> declare a number;
> *
> ERROR at line 1:
> ORA-01400: cannot insert NULL into
> ("SOURCE"."HET_SOURCE_FOODS"."HET_SOURCE_FOOD_ID")
> ORA-06512: at line 5
>
> As you can see, the number is there in the variable a, but I don't
> understand whats going on?
>
> Here is the table definition
>
> SQL> desc source.het_source_foods;
> Name Null? Type
> HET_SOURCE_FOOD_ID NOT NULL NUMBER
> DESCRIPTION VARCHAR2(200)
> DESC_2 VARCHAR2(200)
> FOOD_NAME VARCHAR2(64)
> PREP_TYPE VARCHAR2(64)
> BRAND_ID NUMBER
> CATEGORY_ID NUMBER
> SERVING_DESC VARCHAR2(64)
> PORTION_ID NUMBER
> GRAM_WEIGHT NUMBER
> DATE_CREATED DATE
> DATE_MODIFIED DATE
> MODIFIED_BY VARCHAR2(64)
> CREATED_BY VARCHAR2(64)
>
> Has anyone seen this before, Im I just missing something obvious?
Received on Wed Oct 09 2002 - 16:59:36 CDT

Original text of this message

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