Re: how to convert datatypes ?
Posted in 1996
"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 For substrings the syntax is variablename[startpos, endpos] so, to get left 3 characters of a variable: LET sub_string = string_variable[1,3] or the middle: LET sub_string = string_variable[2,5] >If someone what's to implement a shit app - forget it Informix already did >it ! RTFM! Geez, Mike, you're blaming your ignorance of the product on the product! Informix isn't perfect (but neither are any RDMBS languages!). Personally, I think a programmer who doesn't know his/her syntax will tend to write "shit apps" regardless of what language he/she uses ...