Subject Re: [firebird-support] Substring Function
Author Hans Hoogstraat
Thank You Helen,

I'll rather use the SUBSTR Udf in that case, since I would never remember
or be able to explain, why I used an EXECUTE STATEMENT in the
future :) I know about the SUBSTR limitations.

-------------------------------------------------------------------
----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <firebird-support@yahoogroups.com>
Sent: Friday, October 10, 2003 6:10 PM
Subject: Re: [firebird-support] Substring Function


| At 11:35 AM 10/10/2003 -0600, you wrote:
| >Hello Folks,
| >
| >Using Firebird WI-V6.3.0.3815 Firebird 1.5 Release Candidate 6
| >
| >================================================
| >
| >CREATE PROCEDURE SUBSTRINGTEST (INPUT VARCHAR(12) )
| >RETURNS (OUTPUT VARCHAR(12) )
| >AS
| >DECLARE VARIABLE I INTEGER;
| >BEGIN
| >I = 1;
| >OUTPUT = '';
| >WHILE (I <= 12) DO
| > BEGIN
| > OUTPUT = OUTPUT || SUBSTRING(INPUT FROM I);
| > I = I + 1;
| > SUSPEND;
| > END
| >END
| >=================================================
| >Errors off with
| >ISC ERROR CODE:335544569
| >
| >ISC ERROR MESSAGE:
| >Dynamic SQL Error
| >SQL error code = -104
| >Token unknown - line 10, char 43
| >I
| >=================================================
| >Replacing the variable I in
| >OUTPUT = OUTPUT || SUBSTRING(INPUT FROM I);
| >with a constant like
| >OUTPUT = OUTPUT || SUBSTRING(INPUT FROM 2);
| >works, but of course doesn't render the desired results.
| >
| >Any idea's ?
|
| As currently implemented, the substring function needs constants as
| arguments. However, you can achieve what you want with EXECUTE STATEMENT
| (documentation in release notes!)
|
| h
|
|
|
|
| To unsubscribe from this group, send an email to:
| firebird-support-unsubscribe@yahoogroups.com
|
|
|
| Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|
|
|