On Mon, 04 Aug 2003 04:28:31 -0400, dario wrote:
> I would like to make some math operations with char entity (in
> database).
No problem. Informix automatically converts between ANY compatible type
such as CHAR and numeric so long as the conversion is valid (ie the data
in the column in a particular row is all numeric).
SELECT (tab.my_char_num_fld + 100)
FROM my_table tab
....
Data will return as a DECIMAL type which you can auto convert to any
other numeric type (SMALLINT, INT, SMALLFLOAT, FLOAT, etc.)
If you have 9.xx you can also use type casts:
SELECT (int::tab.my_char_num_fld + 100)
FROM my_table tab
...
Art S. Kagel
> The entity is all numbers but it is defined like char when create table
> was made.
> Is it possible to make some kind of chat to num conversion inside sql
> query without altering table?
>
> Thanks
> Dario Primorac