Re: How to get around variable substring in Informix??
Posted in 1999
Hi,
You can use a subscript:
select * from codetable where code[1,2]="AB"
or matches (regular expression)
select * from codetable where code matches "AB*"I'm sure you can figure out the rest to extend on this.
Neil.
In article <79qi64$6pq$1@nnrp1.dejanews.com>,
4qbhctakkk3vignavx/@lpwa.research.bell-labs.com wrote:
> Hi,
>
> I have the following SQL statement which works fine in Oracle,
> and I'm looking for something equivalent in Informix (Version 7.2.2 ?):
>
> ------------------------------------------------------------------
> select * from codetable where code=substr(code,1,length(newcode));> ------------------------------------------------------------------
>
> I understand that Informix doesn't support variable subscript.
> What's the simplest way to get around this problem (I also tried
> solving this in a for loop, but didn't like the solution)?
>
> Email reply preferred. Thanks.
>
> ---
> Lucie
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own