Subject Re: [firebird-support] Stored Proc to act like the string.Copy method in Delphi
Author Thomas Steinmaurer
Hi Martin,

> Can anyone help me with the following, I have a real problem at site
> where a udf is leaking memory, and I would like to replace the functions
> of it by using a stored procedure instead, this basically involves
> passing in a string, a start index and an end index, I want to return a
> string with the characters found from startindex to the endindex
>
>
>
> Ie.
>
>
>
> DECLARE VARIABLE subStr VARCHAR(1024);
>
>
>
> subStr = Execute procedure '123456789', 1, 5;
>
>
>
> substr would now contain '12345'

How about using the Firebird built-in function SUBSTRING?

For example:

select substring(astring from 1 for 5) from rdb$database



--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2 (NEW!)
Upscene Productions
http://www.upscene.com