Re: Conversion fn?
Posted in 2000
Topics: Data Types & Schema Design
Try select max(col + 0) from tab; Usha M Rao wrote: > It's implicit for all other operations.But if I have to use max or min > function > on the column of char data type having numeric values,it gives me wrong > answer > (ie.,out of 976,1006 the max value it returns is 976). > > Regards, > Usha > > At 10:44 PM 2/23/00 +0000, you wrote: > >Usha M Rao wrote: > >> > >> Is there any character to numeric conversion function in Informix? > > > >As the Clown says, it's implicit, but what do you want to do? You can > >force the implicit conversion by adding a numeric value or zero to your > >char value. For example: > > > > SELECT my_char_value+0 > > FROM my_table > > : > > > >Cheers, > >-- > >Mark. > > > >+----------------------------------------------------------+-----------+ > >| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| > >| http://www.informix.com http://www.informixhandbook.com |///// / //| > >| http://www.iiug.org +-----------------------------------+//// / ///| > >| |What year 2000 bug? year 2000 bug? |/// / ////| > >| |year 2000 bug? year 2000 bug? year |// / /////| > >| |2000 bug? year 2000 bug? year 1900 |/ ////////| > >+----------------------+-----------------------------------+-----------+ > > > > > >
It's implicit for all other operations.But if I have to use max or min function on the column of char data type having numeric values,it gives me wrong answer (ie.,out of 976,1006 the max value it returns is 976). Regards, Usha At 10:44 PM 2/23/00 +0000, you wrote: >Usha M Rao wrote: >> >> Is there any character to numeric conversion function in Informix? > >As the Clown says, it's implicit, but what do you want to do? You can >force the implicit conversion by adding a numeric value or zero to your >char value. For example: > > SELECT my_char_value+0 > FROM my_table > : > >Cheers, >-- >Mark. > >+----------------------------------------------------------+-----------+ >| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| >| http://www.informix.com http://www.informixhandbook.com |///// / //| >| http://www.iiug.org +-----------------------------------+//// / ///| >| |What year 2000 bug? year 2000 bug? |/// / ////| >| |year 2000 bug? year 2000 bug? year |// / /////| >| |2000 bug? year 2000 bug? year 1900 |/ ////////| >+----------------------+-----------------------------------+-----------+ > > >