View previous topic :: View next topic
|
Author |
Message |
smachohalla
New User
Joined: 25 Mar 2008 Posts: 6 Location: Chennai
|
|
|
|
Posted: Thu Apr 02, 2009 11:26 pm Post subject: CONVERT DECIMAL(5,2) TO CHAR
--------------------------------------------------------------------------------
Hi..
Im unloading a DB2 table field which is declared DECIMAL(5,2) into a flat file. i just want it to be casted as CHAR.
For eg. if the table field value is "56.00" i want it be casted into the file as "00056.00".
Please let me know how to give the cast conversion in the unload query for this.
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
would be helpful to see what you are doing to dump the table.
if you are using sql parm - and have a select, normal db2 syntax for the cast will work.
keep in mind you need to end up with a fixed length otherwise the cast will gen a varchar and you will end up with a 'vli' in your dump dataset.
but, again, don't know what you are doing. |
|
Back to top |
|
|
smachohalla
New User
Joined: 25 Mar 2008 Posts: 6 Location: Chennai
|
|
|
|
Hi thanks for ur reply..
yes.. im using an sql parm to dump the table..
i just want to know how to cast decimal(5,2) as CHAR and also capturing the decimal point and the values after it.
please let me know if possible |
|
Back to top |
|
|
|