Subject | Re: [firebird-support] cannot use variable on SUBSTRING |
---|---|
Author | Ivan Prenosil |
Post date | 2005-10-03T06:58:07Z |
> There's something bothering me on using SUBSTRING.Right. FROM&FOR can't use variables. This limitation is removed from Firebird 2.
> I've tried this :
>
> CREATE PROCEDURE SPTEST
> AS
> declare variable vFrom integer;
> declare variable vTo integer;
> declare variable vText varchar(25);
> begin
> vText = 'SUBSTRING TEST';
> vFrom = 3;
> vTo = 10;
> vText = SUBSTRING(vText from :vFrom for :vTo);
> end
>
> "Token Unknown :' is always appear when I create this procedure. Is it right
> that internal function SUBSTRING cannot use variable ? To solve this problem
> I usually using SUBSTR from ib_udf for temporary.
Sometimes as a workaround EXECUTE STATEMENT can be used.
Ivan