Page 1 of 1

Pass the null values to db2 table

PostPosted: Wed Oct 06, 2010 2:25 pm
by eswarreddy
how many ways to pass the null values to db2 table if i declared as emp-id

eswar

Re: db2

PostPosted: Wed Oct 06, 2010 3:27 pm
by enrico-sorichetti
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

Re: db2

PostPosted: Thu Oct 07, 2010 2:30 am
by dick scherrer
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.

Re: db2

PostPosted: Thu Oct 07, 2010 5:11 pm
by GuyC
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

Re: db2

PostPosted: Thu Oct 07, 2010 6:58 pm
by GuyC

Re: Pass the null values to db2 table

PostPosted: Sat Nov 27, 2010 6:38 pm
by RENGANATHAN
using load utility u can pass the null values

Re: Pass the null values to db2 table

PostPosted: Sun Nov 28, 2010 9:19 am
by dick scherrer
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.

Re: Pass the null values to db2 table

PostPosted: Mon Nov 29, 2010 6:15 am
by dick scherrer
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

Re: Pass the null values to db2 table

PostPosted: Mon Nov 29, 2010 6:26 am
by RENGANATHAN
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....

Re: Pass the null values to db2 table

PostPosted: Mon Nov 29, 2010 6:34 am
by dick scherrer
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.