|
|
| Author |
Message |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
Hi,
I am performing a Table Unload through high performance utility.
The nullable fields are replaced with spaces after I perform the
Unload operation.Could any one advise me how to replace them with
spaces. I want Low values instead of spaces in those columns having null.
Currently I am using a sort step to achieve the same.....is there any smarter way through DB2 ?
Regards,
Puspojit |
|
| Back to top |
|
 |
References
|
Posted: Mon May 05, 2008 4:23 pm Post subject: Re: Equivalent representation of Null in Table Unload |
 |
|
|
 |
stodolas
Senior Member
Joined: 13 Jun 2007 Posts: 646 Location: Wisconsin
|
|
|
|
| Null is indicated not by spaces, but by a 1 byte field directly before the unloaded field, the value of it indicates whether or not the field is null. You don't need low values or spaces in the field, just check that 1 byte and you'll know what you need. |
|
| Back to top |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
Hi,
I m sorry I could not make myself clear
I know that null is indicated by one byte field,the null indicator....My question is suppose for a 5 byte nullable column, after I unload it and a Null value was present in the table,then its equivalent in the file would be
5 bytes of spaces and 1 byte for Null indiactor . My question is if there is any way I can change these five spaces to low values during the table unload ?
I am using INZUTILB for the download.
Regards,
Puspojit |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1495 Location: germany
|
|
|
|
why go to that problem? The null indicator (as steve inidicated) is your interrogation point. what if the column for one row is not null, but contains x'00's? you could only tell the difference if you check the null inidcator.
INZUTILB - do a google to get the ibm website concerning this utility and RTFM. do not know (or care) if casting/case expressions are legal with this utility. |
|
| Back to top |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
Hi,
Case and Casting are allowed with INZUTILB utility....But they have not served my purpose .....
Anyways, could there be low values in a Table because a Date column or
say a numeric column would not allow a data to be entered defying its required datatype. And as far as char and varchar are concerned, it can be taken care through the case statement....Please correct me if I am wrong.
Regards,
Puspojit. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1495 Location: germany
|
|
|
|
you are wrong.
| Quote: |
Anyways, could there be low values in a Table because a Date column or
say a numeric column would not allow a data to be entered defying its required datatype
|
then no row would be inserted, or column updated. If nullable column is NULL, then it was set to NULL during insert or update, intentionally by the populator of that colum, not because the value presented as potential column data was invalid.
appears you need to do a little reading about nullable columns. |
|
| Back to top |
|
 |
|
|