Pass the null values to db2 table



IBM's flagship relational database management system

Pass the null values to db2 table

Postby eswarreddy » Wed Oct 06, 2010 2:25 pm

how many ways to pass the null values to db2 table if i declared as emp-id

eswar
eswarreddy
 
Posts: 2
Joined: Tue Oct 05, 2010 10:56 am
Has thanked: 0 time
Been thanked: 0 time

Re: db2

Postby enrico-sorichetti » Wed Oct 06, 2010 3:27 pm

please use meaningful titles when posting
posts with silly/useless titles will usually be skipped by people looking at the forums

if You are sloppy in posting You will lose many opportunities
same comment applies to Your other post titled jcl

it would be useful for you to read and meditate on
How To Ask Questions The Smart Way
http://catb.org/~esr/faqs/smart-questions.html
to make the most out of the questions You ask
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: db2

Postby dick scherrer » Thu Oct 07, 2010 2:30 am

Hello,

how many ways to pass the null values to db2 table
There are zero ways. . .

As there is no such thing as a null value, a null value cannot be "passed".

Suggest you read about what NULL really means in db2.

NULL (by definition) is the absence of any value at all.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: db2

Postby GuyC » Thu Oct 07, 2010 5:11 pm

the question could be :
How do you set a column (empid) of a certain row in a certain table to null ?

the number of ways are endless , but the most common in COBOL is using a null-indicator variable.

exec sql
   update test1
      set empid = null
    where col1 = 'B'
end-exec
exec sql
   insert into test1(col1,empid) values ('E',null)
end-exec
exec sql
   insert into test1(col1) values ('D')
end-exec

move -1 to ws-empid-ind
exec sql
   update test1
      set empid = :ws-empid:ws-empid-ind
    where col1 = 'B'
end-exec

move -1 to ws-empid-ind
exec sql
   insert into test1(col1,empid) values (:ws-col1,:ws-empid:ws-empid-ind)
end-exec
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: db2

Postby GuyC » Thu Oct 07, 2010 6:58 pm

GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Pass the null values to db2 table

Postby RENGANATHAN » Sat Nov 27, 2010 6:38 pm

using load utility u can pass the null values
learner(admin)
RENGANATHAN
 
Posts: 9
Joined: Thu Jul 29, 2010 2:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Pass the null values to db2 table

Postby dick scherrer » Sun Nov 28, 2010 9:19 am

Hello,

using load utility u can pass the null values
NO, it cannot. . .

Did you read and understand the previous replies to this topic?

There is no such thing as a "null value" so no null value can be "passed".

The null indicator may be set, but there is no value to place in the column as there is no value that is null. . . There are 256 possible bit patterns for one byte (x'00' thru x'FF'). Not one of these possible values is a null value.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Pass the null values to db2 table

Postby dick scherrer » Mon Nov 29, 2010 6:15 am

RENGANATHAN ,

Your 2 most recent posts to this topic have been deleted. They were wrong. . .

It doesn't matter how you say it, there is NO null value. . . A column may be nullable, but there is no null value :!:

You can test whether a column IS NULL, but this does test for a null value in the column.

Suggest you concentrate on a more thorough understanding of the basics before posting contradictions. . .

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Pass the null values to db2 table

Postby RENGANATHAN » Mon Nov 29, 2010 6:26 am

in that post am just told a method of passing "null" to clomun(not null value), am just a learner only ,am tried those method to pass "null" in a coloumn so am posted..
if there is anythng wrong in that means regret me....
learner(admin)
RENGANATHAN
 
Posts: 9
Joined: Thu Jul 29, 2010 2:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Pass the null values to db2 table

Postby dick scherrer » Mon Nov 29, 2010 6:34 am

Hello,

From your earlier post:
using load utility u can pass the null values

am just a learner only
Yes, we understand this - we were learners once also :)

if there is anythng wrong in that means regret me....
Not to worry :)

One of the things we (the old guys<g>) stress is the importance of using the correct terms. There are many, many things that are "interchanged" that convey incorrect information.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post