Categories:

Semi-structured and Structured Data Functions (Type Predicates)

IS_DATE , IS_DATE_VALUE¶

Verifies whether a VARIANT value contains a DATE value.

These functions are synonymous.

See also:

IS_<object_type> , IS_TIME , IS_TIMESTAMP_*

Syntax¶

IS_DATE( <variant_expr> )

IS_DATE_VALUE( <variant_expr> )
Copy

Examples¶

Show all DATE values in a VARIANT column.

Note

The output format for date values is set using the DATE_OUTPUT_FORMAT parameter. The default setting is YYYY-MM-DD.

Create and load the table:

create or replace table vardttm (v variant);
Copy
BEGIN WORK;
insert into vardttm select to_variant(to_date('2017-02-24'));
insert into vardttm select to_variant(to_time('20:57:01.123456789+07:00'));
insert into vardttm select to_variant(to_timestamp('2017-02-24 12:00:00.456'));
insert into vardttm select to_variant(to_timestamp_ltz('2017-02-24 13:00:00.123 +01:00'));
insert into vardttm select to_variant(to_timestamp_ntz('2017-02-24 14:00:00.123 +01:00'));
insert into vardttm select to_variant(to_timestamp_tz('2017-02-24 15:00:00.123 +01:00'));
COMMIT WORK;
Copy

Show the DATE values in the data:

select * from vardttm where is_date(v);
+--------------+
| V            |
|--------------|
| "2017-02-24" |
+--------------+
Copy