Re: How to convert a char into an integer
Posted in 1999
Topics: General Discussion
The Informix engine will do it automatically when necessary (assuming the character string can be converted to a numeric). You don't have to bother stripping the quotes around the character string. Laurent.Doublein@par.sita.int wrote: > > Hello, > > I am a rookie on informix pupose and I would like yo convert a string to an > integer value in a where statement > How to do that ??? > > Many thanks > > Laurent > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own > > -- ____________________________________________________________________ | Colin McGrath cmm@trac3000.ueci.com | Raytheon Engineers & Constructors, Inc. (215) 422-4144 | Philadelphia, PA, USA | Any opinions I state are my own and not necessarily of my employer |___________________________________________________________________
Yes, this is true, but beware of performance problems when doing this type of conversion in a WHERE clause. It depends on which field is the char and which is the int. It will convert your char to an int, and then compare; if you have an index on the char, it will not be used. See my FAQ at http://www.geocities.com/SiliconValley/Bridge/4578/faq.html for more info on this phenomenon. June Colin M McGrath wrote: > The Informix engine will do it automatically when necessary (assuming the > character string can be converted to a numeric). You don't have to bother > stripping the quotes around the character string. > > Laurent.Doublein@par.sita.int wrote: > > > > Hello, > > > > I am a rookie on informix pupose and I would like yo convert a string to an > > integer value in a where statement > > How to do that ??? > > > > Many thanks > > > > Laurent > > > > -----------== Posted via Deja News, The Discussion Network ==---------- > > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own > > > > > > -- > ____________________________________________________________________ > | Colin McGrath cmm@trac3000.ueci.com > | Raytheon Engineers & Constructors, Inc. (215) 422-4144 > | Philadelphia, PA, USA > | Any opinions I state are my own and not necessarily of my employer > |___________________________________________________________________ -- june_t@hotmail.com Back in Palo Alto, living on Kit Kat bars and chocolate chip cookies Please do not send Informix questions to this account. I would add 'Please do not send spam to this account' but I suppose I would be wasting my bits.