Re: Number to Character Datatype Translation
Posted in 1998
Topics: Stored Procedures & SPL, Server Administration, Data Types & Schema Design
Thanks Dirk for knocking me in the head and pointing out that no matter
how hard I try, the string expansion of 1.23456789e-35 will not fit in a
varchar(35) column.
And thanks to Volker for pointing this out as well and suggesting that I
try char if varchar does not work.
I have increased the size of my receiving column to 130 bytes, and tried
both char and varchar, but the result is the same.
To recap, I have defined column decimalfloatcol as decimal(32) in table
A. Then I created the following stored procedure:
create procedure test()
returning char(130); define charoutput char(130);
let charoutput = (select decimalfloatcol from A where serialcol
= 2);
return charoutput;
end procedure
After inserting a value of 0.0000000000000000000000000000000000123456789
into decimalfloatcol in table A with serialcol = 2, I ran the above
procedure and got 0.0000000000000000 as a result.
How do I get either 0.0000000000000000000000000000000000123456789 or
1.23456789e-35 (dbaccess's display of this column's value)?
Thanks,
G.Carter
Sybase Replication Agent Development
mailto:greg.carter@homemail.com
mailto:greg.carter@workmail.com
http://www.webaccess.net/~greg.carter