Re: INSTR or CHARINDEX equivalents
Posted in 1997
Topics: Jobs, Consulting & Announcements
Hi,
I think this is the equivalent in DB2 v2.1.
Select field1, fieldn from table where
substr(fieldn, posstr(fieldn, '-') + 1, 8) >= 'value' and
substr(fieldn, posstr(fieldn, '-') + 1, 8) <= 'value'
--
Christopher Che
MSA Client/Server Consultant
Tel: 510 689-7849 Fax: 510 691-8648 Email: msa@sympatico.ca
bmbaker@softart.com wrote in article <860527014.8454@dejanews.com>...
> Here is an Oracle statement I am using:
>
> Select field1, fieldn from table where> substr(fieldn, instr(fieldn, '-') + 1, 8) >= 'value' and
> substr(fieldn, instr(fieldn, '-') + 1, 8) <= 'value'
>
> In SQLServer it is
>
> Select field1, fieldn from table where> substr(fieldn, charindex('-', fieldn) + 1, 8) <= 'value' and
> substr(fieldn, charindex('-', fieldn) + 1, 8) <= 'value'
>
> I am looking for the Informix and DB2 equivalent to the substr...instr
> and/or substr...charindex statements above?
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>