View previous topic :: View next topic |
Author |
Message |
abracadabra Beginner
Joined: 02 Sep 2003 Posts: 101 Topics: 55 Location: India
|
Posted: Fri Feb 13, 2004 4:19 am Post subject: Null |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Feb 13, 2004 6:57 am Post subject: |
|
|
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 |
|
 |
abracadabra Beginner
Joined: 02 Sep 2003 Posts: 101 Topics: 55 Location: India
|
Posted: Fri Feb 13, 2004 7:05 am Post subject: |
|
|
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 |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Fri Feb 13, 2004 7:58 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
abracadabra Beginner
Joined: 02 Sep 2003 Posts: 101 Topics: 55 Location: India
|
Posted: Mon Feb 16, 2004 11:14 pm Post subject: |
|
|
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 |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Tue Feb 17, 2004 8:01 am Post subject: |
|
|
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 |
|
 |
abracadabra Beginner
Joined: 02 Sep 2003 Posts: 101 Topics: 55 Location: India
|
Posted: Fri Feb 20, 2004 2:42 am Post subject: |
|
|
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 |
|
 |
|
|