IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to insert null value into Not null column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Sat Nov 24, 2007 11:32 am
Reply with quote

HI,
I am tryning to insert a null value into no null column. But it is shwoing me an error. Please tell how to insert a null value into not null column.
Back to top
View user's profile Send private message
MKP

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Sat Nov 24, 2007 11:48 am
Reply with quote

Hi,

Use the NULL-INDICATOR to handle this condition.

move -1 to the indicator if the value is NUll.

In the embedded SQL statements we need to add this indiactor with the data host variable
Back to top
View user's profile Send private message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Sat Nov 24, 2007 12:09 pm
Reply with quote

Thank u !!

What is the use of null indictor in select statement.?? Pls explain.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Nov 24, 2007 11:40 pm
Reply with quote

Hello,

Quote:
I am tryning to insert a null value into no null column.
If the column is defined as NOT NULL you need to have the definition of the column changed to support NULL values.

If the design/definition specifies nulls are not allowed, why is there a need to put a null value in that column?

I suggest you talk with project lead or dba to determine how to proceed.
Back to top
View user's profile Send private message
vadivem

New User


Joined: 08 May 2006
Posts: 24
Location: pune

PostPosted: Tue Nov 27, 2007 12:14 am
Reply with quote

Prabha,

What dick has suggest it's exactly correct the reason behind the NOT NULL is based on data model(table definitions).

So interact with your DBA why its or what it's?
Back to top
View user's profile Send private message
fayazbashask

New User


Joined: 28 Jun 2007
Posts: 9
Location: Hyderabad

PostPosted: Tue Nov 27, 2007 11:57 am
Reply with quote

Hi,
anyway if the constraint has given as NOT NULL, you can't insert null values. Why can't you insert a default value for it?
Contact your DBA.....

Regards,
Fayaz
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top