Re: how to convert datatypes ?
Posted in 1996
Topics: Stored Procedures & SPL, Data Types & Schema Design, Migration, Import/Export & Data Conversion
Dennis Collin <dcollin@connix.com> schrieb im Beitrag
<57tm8g$bi0@beast.connix.com>...
> "Michael Agbaglo" <byteshif@cs.tu-berlin.de> wrote:
>
> >First I had to write extra code because this amateur programmers a
informix
> >weren't able to implement select ... into ... order by.
>
> >Then I browsed the manuals for 'convert' w/o success. When I do a
> >LET Stmt = VARCHAR( foo );
> >it thinks VARCHAR is a procedure --- Arrgh!
> >Then I browsed for string functions - nothing, no MID, LEFT, RIGHT...
> >Have they been exhausted by implementing 'LENGTH' ?
>
> Informix performs data conversions (integer to string, etc)
> implicitly! Just make the assignment, and informix does the rest:
>
> DECLARE string_variable STRING(7)
> DECLARE integer_variable INTEGER
>
> LET string_variable = integer_variable
create procedure foo()define i integer;
define s string;
let s = "asdfsa" + i + "dsgdfsg";
end procedure;
1213: implicit character to numeric conversion
REALLY NICE !