SYSTEM$STREAM_GET_TABLE_TIMESTAMP

functiondeferredTables, views, streams, sequences

docs.snowflake.com ↗

System functions

Returns the timestamp in nanoseconds of the latest table version at or before the current offset for the specified stream. When the stream is queried (or consumed), the records returned include all transactions committed after this table version and before the current time. Note This function was created primarily as a means to “bootstrap” a stream (i.e. return the set of records inserted between the period when the table was created (at table version t0) and the specified stream was created). Since this function was introduced, CREATE STREAM and SELECT statements that include the CHANGES clause now support Time Travel using the AT | BEFORE clause. These options provide greater flexibility for querying historical table records.

Syntax

SYSTEM$STREAM_GET_TABLE_TIMESTAMP('<stream_name>')

Parameters

NameRequiredDescription
stream_namerequiredThe name of the stream to query. Note that the entire name must be enclosed in single quotes, including the database and schema (if the name is fully-qualified), i.e. '<db>.<schema>.<stream_name>'. If the stream name is case-sensitive or includes any special characters or spaces, double quotes are required to process the case/characters. The double quotes must be enclosed within the single quotes, i.e. '"<stream_name>"'.

Usage notes

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.