|
|
Archives of the TeradataForum
Message Posted: Fri, 30 May 2003 @ 13:09:33 GMT
Subj: | | Re: Queryman vs interagate and ODBC effect on formatting |
|
From: | | Geoffrey Rommel |
| When I run a query with format clause, in queryman, I notice (using PMON) that Teradata RDBMS sees the format clause. Shouldn't the
RDBMS then convert the decimal value to a character, using that format clause and then send it back?? | |
Well, not really. Every selected expression has a data type; if you're just selecting a column, it is the data type of that column. For
instance:
select phone_no, /* data type is char(9), let's say */
distance_btw_galaxies, /* float */
gross_sales - returns /* decimal(9,2) */ ...
The format is not part of the data type; it is just an added piece of information that the requesting program can choose to honor
if it wishes. BTEQ honors it; Queryman does not.
You can force the desired format in Queryman/ODBC by saying:
select cast(cast(decimal_value as format 'Z,ZZZ,ZZ9.99') as char(13)) ...
This changes the data type from decimal to char(13).
| |