Re: ORACLE substr in INFORMIX
Posted in 1998
The sad thing is that Informix does not support variables or expressions as
substring parameters in SQL (this includes stored procedures). If it did,
you would not need the procedure. You could
just write something like select string[pos,len] from table ...
Perhaps this will change in a future version. I've heard that Informix is
working on a lot of enhancements to SPL.
Volker Fraenkle <VFraenkle@cs-controlling.de> wrote in article
<3552B68D.758F6447@cs-controlling.de>...
> Hello evereyone,
> is there a possibility to copy the substr command from oracle. I
> developed following SP:
>
> create procedure cs_substr (cString char(255), iFPos smallint, iLen
> integer)
> returning char(255);>
> return cString[iFPos, iFPos + iLen - 1];
>
> end procedure;
>
> While running via dbaccess following error occurs:
> 201: A syntax error has occurred.
> Error in line 5> Near character position 17
>
> When I switch to
> return cString[15,15];
>
> the SP will be created. What is my problem?
>
> Thank you, Volker
>
> --
> Volker Fraenkle E-Mail: VFraenkle@cs-controlling.de
> CS Controlling Phone: +49 7144 8144-0
> Software Systeme GmbH Fax: +49 7144 8144-10
> Riedbachstrasse 5
> 74385 Pleidelsheim
>