Re: Convert numeric to char in SQL
Posted in 1998
novaboy1@my-dejanews.com wrote:
>
> Hi,
> In IUS 9.1 it is possible to execute the following sql statement(day is a
> char in the calendar table)
>
> select (day::numeric) from calendar
>
> The result is that the SQL display the expressions, of day, now converted to a
> char.
>
> In Online 7.1, it is not possible to execute the sql script, syntax
> error??.
>
> Does anyone know of a way around this?????
>
There's no explicit type cast operator available in IDS 7.x.
A stored procedure might help, if it is neccessary to convert
from one type into another type.
create procedure ctoi ( value int ) returning varchar(255); return value;
end procedure;
select ctoi( 5 ) from atable;
Even if I don't understand, why you need a conversion from
character to int, this procedure would do it for you.
Bye
Stefan Weideneder