Diese Prozedur gibt 1 zurück falls s eine Zahl ist ansonsten eine 0.
CREATE PROCEDURE ISZAHL (S VARCHAR (100))
RETURNS (ISZAHL SMALLINT)
AS
declare variable l integer;
declare variable i integer;
declare variable c char(1);
BEGIN
l=char_length(s);
if (s is null or l=0) then
ISZAHL=0;
else begin
i=1;
ISZAHL=1;
while (i<=l and ISZAHL=1) do begin
c=substring(S from i for 1);
if (c between '0' and '9' or (i=1 and c in ('+','-'))) then
i=i+1;
else
ISZAHL=0;
end
end
SUSPEND;
END
Tags: Firebird SQL