SE7.23: select TRIM... in unload problem
Posted in 2000
Topics: Stored Procedures & SPL, Migration, Import/Export & Data Conversion
Hallo! Under SE 7.23 using a "select TRIM(x,0) x from ..." displays x without a decimalpoint and no decimalnummers as discripted. But using "unload to .... select TRIM(x,0) x from ..." has a decimalpoint and a following zero. Is it a bug? Any workaround? Cheers Peter
You mean ROUND, not TRIM, don't you?
You could use a stored procedure to round your decimal columns and
convert them to char. For example,
CREATE PROCEDURE dec_to_char(l_decimal dec(16,3)) RETURNING char(16);
DEFINE l_char16 char(16);
LET l_char16 = ROUND(l_decimal, 0);
RETURN l_char16;
END PROCEDURE
Rudy
Peter wrote:
> Hallo!
> Under SE 7.23 using a "select TRIM(x,0) x from ..."
> displays x without a decimalpoint and no decimalnummers as discripted.
> But using
> "unload to .... select TRIM(x,0) x from ..." has a decimalpoint and a
> following zero.
> Is it a bug?
> Any workaround?
> Cheers
> Peter
On Wed, 12 Jan 2000 17:55:55 GMT, proORGA-Leimen@t-online.de (Peter) wrote: >Hallo! >Under SE 7.23 using a "select TRIM(x,0) x from ..." >displays x without a decimalpoint and no decimalnummers as discripted. >But using >"unload to .... select TRIM(x,0) x from ..." has a decimalpoint and a >following zero. >Is it a bug? >Any workaround? >Cheers >Peter OH, sorry - it is not TRIM(), problem happens with TRUNC(x,0). TRUNC(1234.0,0) shows without unload-part 1234 and with the unload 1234.0 Cheers Peter