ASA SQL Reference
SQL Functions
Alphabetical list of functions
Tests if a string argument can be converted to a date. If a conversion is possible, the function returns 1; otherwise, 0 is returned. If the argument is null, 0 is returned.
ISDATE ( string )
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Not supported by Adaptive Server Enterprise.
The following example imports data from an external file, exports rows which contain invalid values, and copies the remaining rows to a permanent table.
create global temporary table MyData(
person varchar(100),
birth_date varchar(30),
height_in_cms varchar(10)
) on commit preserve rows;
load table MyData from 'exported.dat';
unload
select *
from MyData
where isdate(birth_date)=0
or isnumeric(height_in_cms)=0
to 'badrows.dat';
insert into PermData
select person,birthdate,height_in_cms
from MyData
where isdate(birth_date)=1
and isnumeric(height_in_cms)=1;
commit;
drop table MyData;