Subject RE: [firebird-support] Stored Proc to act like the string.Copy method in Delphi
Author Martin Dew
Martijn, the UDF is not mine, it is the FreeUDFLib Library, and if I
could just get it to work this way my customer would not have system
crashes every night at 2 am when they are busy running an emergency
critical system because FB is using 1.9gb of memory, and I thus get
called and end up having to take their system down and back up safely at
that time in the morning too.



The way I see it is I have the option of the following stored proc ( if
anyone can help me get the char out of the string at that placement), or
trying to find another udf which does what I need, which is 100% memory
safe;





DECLARE VARIABLE Tmp VARCHAR(1024);

DECLARE VARIABLE Pos INTEGER;

BEGIN

CopyString = '';



IF (Str IS NULL) THEN BEGIN

CopyString = 'ER1';

EXIT;

END



IF (StartIndex >= EndIndex) THEN BEGIN

CopyString = 'ER2';

EXIT;

END



Tmp = '';

Pos = 0;



WHILE (pos <= EndIndex) DO BEGIN

if(POS >= STARTINDEX and POS <= ENDINDEX) THEN BEGIN

CopyString = COPYSTRING || 'A';

END

Pos = Pos + 1;

END



END



Martin Dew

Senior Developer

Adastra Software Ltd.

Unit 4, Eurogate Business Park, Ashford, Kent TN24 8SB

Tel: (01233) 722700 Fax: (01233) 722701 www.adastra.co.uk
<BLOCKED::http://www.adastra.co.uk/>



________________________________

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Martijn Tonies
Sent: 05 July 2005 13:15
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Stored Proc to act like the string.Copy
method in Delphi



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

It might be me, but why not fix the UDF?? :-)

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS
SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





________________________________

YAHOO! GROUPS LINKS



* Visit your group "firebird-support
<http://groups.yahoo.com/group/firebird-support> " on the web.

* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe
>

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .



________________________________



[Non-text portions of this message have been removed]