Hi
I have just started learning oracle.
i have created a table with name imp_master and columns item_code with constraint not null, item_name with constraint n1 not null(n1 is user defined constraint name), item_rate and item_desc.
the copmmand is as follows...
CODE:
create table item_master
( item_code varchar2(25) not null,
item_name varchar2(25) n1 not null,
item_rate number(7,2),
item_desc varchar2(50) );
table has been created with the above mentioned columns. i have checked it with the command " desc item_master;"
After this has been done i have altered the column "item_desc" with the command " alter table item_master modify item_desc not null; "
the column has been altered.
To check this i have entered the command
Insert into table item_master (item_desc) values (null); The problem is here
instead of showing the message that the column item_desc does not take null values... it is throwing error message
ERROR MESSAGE :
ORA_01400 cannot insert null into
( "SCOTT"."ITEM_M ASTER"."ITEM_CO DE")
even though i am trying to enter nulls into "item_desc" column ... it is referring to "item_code" column.
After this i have modified the item_desc to accept the null values. And then i ran command to enter the values into the column. Then also it is throwing the error message as
ERROR MESSAGE:
ORA_01400 cannot insert null into
( "SCOTT"."ITEM_M ASTER"."ITEM_CO DE")
I am programming in oracle 9. OS is windows 200 advanced server.
Help appreciated.
3 2192
Hi,
You are doing following.... -
Insert into table item_master (item_desc) values (null);
-
So here what is happening is you are inserting value(null in this case) for item_desc but you are not specifying any value for other columns so NULL will be inserted for them. And thats why you are getting this error cause you've specified NOT NULL constraints for first two columns so NULL is not allowed for them.
If you want to check your item_desc column for NULL try the following query -
Insert into table item_master (item_code,item_name,item_desc) values ('somevalue','somevalue',null);
-
For column item_rate you haven't specified any constraints so error will not be thrown.
Regards,
RP
Well ,that is how oracle performs.
If you see your table structure, the first column ITEM_CODE is described as NOT NULL. So any insert statement not entering value for this column will throw this error.
If you try the below insert statement: -
insert into ITEM_MASTER(item_code) values('1');
-
It will throw you an error saying "CANNOT INSERT NULL INTO item_name" and so on.
Oracle will take in order the columns from the table and throw an error accordingly!!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeff Harbin |
last post by:
I've spent the last 2 days trying to begin using mysql. I've purchased 3
books and read huge chunks of the documentation provided with the mysql zip
file.
I've downloaded 'mysql-4.0.18-win.zip', unzipped it, run the WinMySqlAdmin
program, and everything seems fine. I'm trying to use it on WindowsXP on a
new machine.
I'm trying to learn mysql from scratch using the command line before I play
with what I'm assuming are GUI for mysql. ...
|
by: Ken Cox [Microsoft MVP] |
last post by:
MS has posted this here:
http://www.asp.net/faq/ms03-32-issue.aspx
Fix for: 'Server Application Unavailable' Error after Applying Security Update
for IE
-------------------------------------------------------------------------------
-
|
by: Microsoft News Server |
last post by:
Hi,
I am currently having a problem with random, intermittent lock ups in my
ASP.net application on our production server (99% CPU usage by 3 threads,
indefinately). I currently use IIS Debug Tools to do a memory dump of the
app when the lock up occurs, however the stack information is not very
useful.
I have just put a new build of our system onto production, and this build is
a "Debug" build as opposed to a "Release" build. I am...
|
by: Sean Shanny |
last post by:
To all,
Running into an out of memory error on our data warehouse server. This
occurs only with our data from the 'September' section of a large fact
table. The exact same query running over data from August or any prior
month for that matter works fine which is why this is so weird. Note that
June 2004 through today is stored in the same f_pageviews table.
Nothing has changed on the server in the last couple of months. I upgraded...
|
by: michael sorens |
last post by:
(1) I tried to use what seems like a standard line (from Walkthrough:
Creating a Windows Service Application in the Component Designer at
http://msdn2.microsoft.com/en-us/library/zt39148a.aspx):
if (!System.Diagnostics.EventLog.SourceExists("MySource")) { ...
But received this error when attempting to start the service:
System.Security.SecurityException was unhandled
Message: The source was not found, but some or all event logs could...
| |
by: deathtospam |
last post by:
A day or two ago, I wrote a quick ASPX page with a CS codebehind using
Visual Studio .NET 2005 -- it worked, I saved it and closed the
project. Today, I came back to the project, reopened the solution, and
was greeted with the following error:
========================================================================
It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error...
|
by: Norman Diamond |
last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet
Framework 2. Options are set in the setup project properties, so if these
two dependencies are not already installed then this installer will install
them.
But what about the situation where VC runtime has already been installed?
In fact it's been installed twice. Although the project was built on a
Windows XP system with Visual Studio 2005 SP1 and the results were...
|
by: AAaron123 |
last post by:
I downloaded the personal website starter kit and when I run it I get the
error shown below.
I found a way of using Launch Surface Area Configuration that is supposed
to fix the remote setting but I tried it and still get the error.
I do not have SQL Server 2005 installed (thought I did once). I do have SQL
Server 2008 installed.
I don't see anywhere in the code where SQL Server 2005 is referenced.
|
by: Tony |
last post by:
I am continuing to develop an Access 2007 application which was
originally converted from Access 2003. In Access 2003 I was able to
disable the Access Close button in the top righthand corner of the
screen. I have been unable to find any way to disable this button in
Access 2007 and subsequently I have been forced to find ways to detect
and handle the situations after the Access Close button has been
clicked.
I have been largely...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |