Subject | Re: [firebird-support] Cast SQL |
---|---|
Author | Martijn Tonies |
Post date | 2004-06-03T08:30:02Z |
Hi James,
create procedure docast (checkno <checkno datatype>) returns (checkno_int
bigint)
as
begin
begin
checkno_int = cast(checkno as bigint);
when all do checkno_int = 0;
end
suspend;
end
and then:
select checkno, (select checkno_int from docast(checkno))
from payment
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I have a sql statement like thisThe best thing I can think of is something like this:
>
> select checkno, cast(checkno as bigint)
> from payment
>
> My problem is that some value in checkno contains non numeric
> characters. how can I tell the Firebird to skip those records which
> contains non numeric charaters in order to prevent the avobe sql
> statement to give error message?
create procedure docast (checkno <checkno datatype>) returns (checkno_int
bigint)
as
begin
begin
checkno_int = cast(checkno as bigint);
when all do checkno_int = 0;
end
suspend;
end
and then:
select checkno, (select checkno_int from docast(checkno))
from payment
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com