Contents Index INTTOHEX function [Data type conversion] ISNULL function [Data type conversion]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

ISDATE function [Data type conversion]


Function 

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.

Syntax 

ISDATE ( string )

Standards and compatibility 
Example 

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;

Contents Index INTTOHEX function [Data type conversion] ISNULL function [Data type conversion]