Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to insert null value into Not null column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to insert null value into Not null column
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    Post subject: Reply to: How to insert null value into Not null column
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    Post subject: Reply to: How to insert null value into Not null column
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

Site Director


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

PostPosted: Sat Nov 24, 2007 11:40 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: How to insert null value into Not null column
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us