TIMESTAMP Data Type

Description

The TIMESTAMP data type is an extension of the DATE data type. It stores the year, month, and day of the DATE data type, plus hour, minute, and second values. (Oracle SQL Language Reference Timestamp Data Type)

Both Oracle and Snowflake TIMESTAMP data types have the same precision range (0-9) but different default values. In Oracle, the default precision value is 6 and in Snowflake is 9.

However, there is a difference in behavior when an inserted value exceeds the set precision. Oracle rounds up the exceeding decimals, while Snowflake just trims the values.

TIMESTAMP [(fractional_seconds_precision)] 

Sample Source Patterns

Timestamp in Create Table

Oracle

CREATE TABLE timestamp_table
(
	timestamp_col1 TIMESTAMP,
	timestamp_col2 TIMESTAMP(7)
);

INSERT INTO timestamp_table(timestamp_col1, timestamp_col2) VALUES (TIMESTAMP '2010-10-10 12:00:00', TIMESTAMP '2010-10-10 12:00:00');

Snowflake

CREATE OR REPLACE TABLE PUBLIC.timestamp_table (
timestamp_col1 timestamp,
timestamp_col2 timestamp(7));

INSERT INTO PUBLIC.timestamp_table(timestamp_col1, timestamp_col2) VALUES (TIMESTAMP '2010-10-10 12:00:00', TIMESTAMP '2010-10-10 12:00:00');

Retrieving data from a Timestamp column

Oracle

SELECT * FROM timestamp_table;

Snowflake

SELECT * FROM PUBLIC.timestamp_table;

Known Issues

No issues were found.

  1. No related EWIs.

Last updated