Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Remember me

Go Back   Tutorialized ForumsDatabasesOracle

Add This Thread To:   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
Unread Tutorialized Forums Sponsor:
Old January 4th, 2012, 09:17 AM
lerono lerono is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
Join Date: Jan 2012
Posts: 1 lerono User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 23 sec
Reputation Power: 0
ORA-01400: cannot insert NULL

I am working on a project, the insert statement is not functioning properly and I cannot find the error The error is in the insert statement for CustOrder. The error states that NULL cannot be inserted into CustOrder.CustID. I have declared CustID and its reference. I have looked over the code several times and I cannot find the problem.

If it makes a difference I am using APEX. The company has not database or program to work with a database so I am building everything from scratch.

Any advice is greatly appreciated. Thanks in advance!

  l_CustOrderID number;
  l_CustID number := :P11_CustID;


  l_CustID := :P18_CustID;
end if;

-- Fetch values that need to be inserted into the Order Header
select CustOrder_seq.nextval into l_CustOrderID from dual;

-- Insert a row into the Order Header table
insert into CustOrder values(l_CustOrderID, sysdate, l_CustID, NULL, NULL);
-- Loop through the ORDER collection and insert rows into the Order Line Item table
for x in (select c001, c003, sum(c004) c004 from apex_collections 
  where collection_name = 'ORDER' group by c001, c003)
  insert into OrderLine values 
    (NULL, l_CustOrderID, x.c001, to_number(x.c004), to_number(x.c003));
end loop;

-- Truncate the collection after the order has been placed
apex_collection.truncate_collection(p_collection_n  ame => 'ORDER');

-- Set the item P14_ORDER_ID to the order which was just placed
:P14_CustOrderID := l_CustOrderID;

Reply With Quote

Viewing: Tutorialized ForumsDatabasesOracle > ORA-01400: cannot insert NULL

Developer Shed Advertisers and Affiliates

Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap