SELECT address FROM customer WHERE client_id =
substring('XYZ-someid',5,10);
Thanks,
-TAG
Todd A. Gibson
You can use the SUBSTR() function in 7.30.
Why would you be substringing a literal, though?
In earlier versions, you have to use (and in 7.30, you may use):
SELECT address FROM Customer
WHERE Client_id[5,15] = 'XYZ-someid';
Note that this version uses [start-index, stop-index] whereas the
function uses SUBSTR(source, start-index, length).
Yours,
Jonathan Leffler (jlef...@informix.com) #include <witticism.h>
Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN
Informix IDN for D4GL & Linux -- http://www.informix.com/idn
try
SELECT address FROM customer WHERE client_id[5,10] = "XYZ-someid";
I hope this help,
Irineu
> ----------
> From: Todd Gibson[SMTP:tgi...@flatland.dimensional.com]
> Reply To: Todd Gibson
> Sent: Tuesday, October 20, 1998 2:23 PM
> To: inform...@iiug.org
> Subject: substring in informix SQL?
>
> Is there any way to get a substring in a SQL expression?
> Something like:
>
> SELECT address FROM customer WHERE client_id =
> substring('XYZ-someid',5,10);
>