Subject | Substring Function |
---|---|
Author | Hans Hoogstraat |
Post date | 2003-10-10T17:35:18Z |
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 ?
Thank You
Hans
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 ?
Thank You
Hans