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

I'm going crazy - Sequence, insert problem

From: steve deno <sldcrew2k_at_yahoo.com>
Date: 9 Oct 2002 11:52:12 -0700
Message-ID: <8e6b14d8.0210091052.29a508c5@posting.google.com>


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 - 13:52:12 CDT

Original text of this message

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