Subject Re: [firebird-support] Stripping certain characters from strings
Author Lucas Franzen
Daniel,


Daniel Albuschat schrieb:
> On Mon, 07 Mar 2005 12:43:13 +0100, Lucas Franzen <luc@...> wrote:
>
>
>>use an extra field to store nothing but the digits and search onb this one.
>>
>>I'm not sure which UDF funtion will do it, but you can also use a
>>Storedproc to do so:
>
>
> Hi,
>
> I've re-formulated the stored procedure to be a trigger (one for update,
> one for insert)

Why???

If you use a stored proc you have to write it just once and you can use
it in any trigger you like.

CREATE TRIGGER ....
AS
TEL_DIGIT VARCHAR(40);
BEGIN
EXECUTE PROCEDURE SP_DIGITSONLY ( NEW.TELEPHONE_NO )
RETURNING_VALUES ( :TEL_DIGIT );

NEW.TELEPHONE_DIGIT_COLUMN = TEL_DIGIT;

END

Luc.