Subject Re: [firebird-support] Re: Stripping non numerics from a string column
Author Rich Pinder
Jack, being the pragmatic dog I am, my premise are quite flexible !!
(and THANKS for the offer - I would love to take you up on it... I've
become comfortable with 'installing' UDF, as long as they have the
associated registration code !!!). This project is indeed on a Win32
version of FB - and I know the SP way to go would allow the fix in the
Linux OS world.

Nice thing about a UDF is I could use it against columns/selects/ etc
... at will... down the line. I've been spoiled by the various
'scripting' languages around for one'offs, and continue to always grab
Delphi (still 7) when I need more gusto. [and I do remember the days on
that little Ashton Tate software, where you'd accomplish this with one
terribly ugly long line typed in at the . prompt !! ]

Re FB - what I do believe I'm up against is learning/understanding how
the SP world, interacts with the Trigger world. I think my 'errors' may
have to do with the use of arguments - and if I modified the SP to just
do one, simple set of tasks (requiring no parameter), them maybe I could
hook it to a trigger. Havent found the magic grail on this one...even
after reading Helen's book (but I'm definately not the brightest bulb
on the tree!)

Thanks again for your help, and if you'd share that .dll... well, I'll
be quite happy to take it !!

Rich Pinder
USC School of Medicine
rpinder@...


jrodenhi wrote:
>
> Rich,
> I know this violates your basic premise that you don't want to have to
> write your own function, but I would say that this is a problem that
> begs for a udf solution. One of Firebird's major selling points is
> the way that it allows you to extend it's functions with Delphi. I
> wrote a function that I think does exactly what you need in Delphi. I
> use it to strip the hyphens out of social security numbers. Here is
> the function:
>
> function StripChar(const sTarget: string; const sStripChar: string):
> string;
> var i: Integer;
> s: String;
> begin
> s := sTarget;
> for i := 1 to Length(sStripChar) do begin
> While Pos(sStripChar[i], s) > 0 do
> Delete(s, Pos(sStripChar[i], s), 1);
> end;
> Result := s;
> end;
>
> This gets included in my customized version of the tbudf dll. If that
> would fix the problem for you, I would be glad to send the dll and its
> source.
>
> -Jack
>
>