Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us