View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear Experts,
I have column with a datatype "FLOAT" in a DB2 table.
I like to unload the specified columns along with this FLOAT datatype column into a flat file (all other columns are alpha-numeric).
Please suggest me ,
how to write the query ? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is your problem?
do you want to 'convert' cast the float column to something else,
or do you want to have a receiving field defined as float? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear dbzTHEdinosauer,
In the table column is defined as float.
If I write the Query like
SELECT col1, col2
FROM table-name
Col2 is of datatype FLOAT, The values unloaded from a table to flat file are not readable format, How to achieve this ?? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
That means:
Quote: |
you want to 'convert' cast the float column to something else |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
The values unloaded from a table to flat file are not readable format |
that is not true. you don't know how to read it
and it seems that you are not going to try.
if the required results are to be just a display type of report,
do as Anuj suggested and cast to another numeric datatype - that you can read
if the data is to be used as input to a program and the integrity of the value is of concern,
suggest you leave it as float,
and define it as such in the program processing the file.
you should also take the novel approach of reading the manual
concerning the loss of precision when casting float datatype columns. |
|
Back to top |
|
|
|