MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Null

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Feb 13, 2004 4:19 am    Post subject: Null Reply with quote

Hi

I have a situation where
I have 3 fields...A,B,C
A's def is decimal (4,6) not null
B - decimal (4,6)
C - decimal (4,6)

Now i have move zero to 3 ws-variable A',B',C' whose def are all 9(4)v9(6) comp-3..or something like that

now the A',B',C' variables are moved to the table and updated

when i do an online query in spufi i see that A has value 0.00 or something similar while B and C have value '----'
what does ---- mean? is it a null value?
why is 0 not showing up?
In batch spufi B and C show up with values '?'

Thanks
_________________
Cheers!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 13, 2004 6:57 am    Post subject: Reply with quote

abracadabra,

There is an error in your table definition. They should be defined as DECIMAL (10 ,6). You had it as decimal(4, 6) which is wrong.

If you had moved zeroes to a,b,c and updated the table then you should see zeroes for a,b,c in spufi.

If you are using column functions like max, min... then you will see --- which means it is null. If you want a default value of '?' for a null value then use COALSCE OR VALUE function.

Code:

SELECT A,
      ,VALUE(B,'?')             
      ,VALUE(C,'?')
  FROM TABLE
  ;


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Feb 13, 2004 7:05 am    Post subject: Reply with quote

No Kolusu, the definition is actually Decimal (10,6). Whenever i put any other value other than zero it is getting updated with that value.for ex 1,2 etc. However, the problem is with zero/0. Could it be possible that there is a check constraint on these columns.? If so, can you tell me the SYSIBM catalog Table where i can find this.

Thanks
_________________
Cheers!
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Fri Feb 13, 2004 7:58 am    Post subject: Reply with quote

abracadabra,
Can you post the update SQL - are you using the null indicators correctly. A is not null so its good, what about B and C they should have their null indicators populated correctly with 0 and used in the update sql. Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 13, 2004 12:43 pm    Post subject: Reply with quote

Abracadbra,

The table check constraints can be found in SYSIBM.SYSCHECKS table

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Mon Feb 16, 2004 11:14 pm    Post subject: Reply with quote

Suresh,

Do you mean to say that since B and C are defined as NOT NULL, we should move 0 to the Null Indicators.
I am not sure I got your explanation correctly

Thanks
_________________
Cheers!
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Feb 17, 2004 8:01 am    Post subject: Reply with quote

abracadabra,
Its allways good to use the Null indicators allong with the corr column. When I said 0, I ment to initialize the null indicator. Thanks
Back to top
View user's profile Send private message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Feb 20, 2004 2:42 am    Post subject: Reply with quote

Hi Suresh,

The problem was actually with the null indicator. When u mentioned null indicator I went and checked the code and saw that for zero value the code was actually moving -1 to the null indicator.

Thanks for your help
_________________
Cheers!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group