Re: Str Function
Posted in 1998
Topics: General Discussion
I'm not saying this is going to be fast or efficient, but...
select * from tableA where trunc(numeric_column / (pow(10,
(length(numeric_column || "") -2)))) ="15" [and length(numeric_column || "")> 1] <-- optional if length might be < 2
This method will do a bunch of operations on each record, but cuts each one
down to its first two digits.
In article <72t5am$st7$1@news.xmission.com>,
Jose Miguel Giraldez <jgiralde@ucsm.edu.pe> wrote:
>
> What if I need to do something like:
> select * from tableA where numeric_column[1,2]="15"> without using a cursor.
>
> Jos' Miguel.
>
> Art S. Kagel wrote:
>
> > Jos' Miguel Giraldez R. wrote:
> > >
> > > Hi all:
> > > Would you be kindly to help this newbie to find the informix function,
that
> > > converts numeric columns to character type, equivalent to STR?
> >
> > There is no such function since Informix automatically converts between
> > text and numeric based on the type of the variable you are fetching the
> > data into. Fetch that integer into a string and voila! it's a string.
> >
> > Art S. Kagel
>
>
--
--Marty Allred
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own