Subject | AW: [firebird-support] Re: convert, cast |
---|---|
Author | Olaf Kluge |
Post date | 2011-05-14T18:48:14Z |
Hello,
I have a solution:
CREATE PROCEDURE U_ISNUMERIC (
VALUE_PARAM VARCHAR (256))
RETURNS (
TRUE_PARAM SMALLINT)
AS/**/begin
if (cast(value_param as bigint) is null) then
true_param = 0;
else
true_param = 1;
suspend;
when any do
begin
true_param = 0;
suspend;
end
end
This stored procedure checks the input if it is numeric.
Is this okay? Better ideas?
Best greetings.
Olaf
[Non-text portions of this message have been removed]
I have a solution:
CREATE PROCEDURE U_ISNUMERIC (
VALUE_PARAM VARCHAR (256))
RETURNS (
TRUE_PARAM SMALLINT)
AS/**/begin
if (cast(value_param as bigint) is null) then
true_param = 0;
else
true_param = 1;
suspend;
when any do
begin
true_param = 0;
suspend;
end
end
This stored procedure checks the input if it is numeric.
Is this okay? Better ideas?
Best greetings.
Olaf
[Non-text portions of this message have been removed]