Subject | Re: [firebird-support] Substring Function |
---|---|
Author | Helen Borrie |
Post date | 2003-10-11T03:59:57Z |
At 08:54 PM 10/10/2003 -0600, you wrote:
CREATE PROCEDURE SUBSTRINGTEST (INPUT VARCHAR(12) )
RETURNS (OUTPUT VARCHAR(12) )
AS
DECLARE VARIABLE I INTEGER;
declare variable ch char;
declare variable exestring varchar(200);
BEGIN
I = 1;
OUTPUT = '';
WHILE (I <= 12) DO
BEGIN
exestring = 'select substring('''||INPUT||''' from '||i||' FOR 1) FROM
RDB$DATABASE';
execute statement exestring into ch;
if (ch is not null) then
begin
OUTPUT = OUTPUT ||ch;
SUSPEND;
end
else
exit;
I = I + 1;
END
END ^
heLen
>Helen,Nope, I couldn't imagine it would.
>
>I don't think you can use
>OUTPUT = OUTPUT || EXECUTE (....
>since EXECUTE doesn't seem to return any results
>------------------------------------------------------------
CREATE PROCEDURE SUBSTRINGTEST (INPUT VARCHAR(12) )
RETURNS (OUTPUT VARCHAR(12) )
AS
DECLARE VARIABLE I INTEGER;
declare variable ch char;
declare variable exestring varchar(200);
BEGIN
I = 1;
OUTPUT = '';
WHILE (I <= 12) DO
BEGIN
exestring = 'select substring('''||INPUT||''' from '||i||' FOR 1) FROM
RDB$DATABASE';
execute statement exestring into ch;
if (ch is not null) then
begin
OUTPUT = OUTPUT ||ch;
SUSPEND;
end
else
exit;
I = I + 1;
END
END ^
heLen