SYSTEM$LAST_CHANGE_COMMIT_TIME | Snowflake Documentation (original) (raw)

Categories:

System functions (System Information)

Returns a token that can be used to detect whether a database table or view changed between two calls to the function. If the token returned by a call is different from the token returned by a separate call, then the table or view changed between the two calls, typically due to a DML operation (e.g. an INSERT).

If the specified database object is a view, then at least one of the database objects referenced by the view changed.

Syntax

SYSTEM$LAST_CHANGE_COMMIT_TIME( '' )

Arguments

_objectname_

Specifies the table or view.

Returns

The data type of the returned value is NUMBER with a scale of 0.

Usage notes

Examples

CALL SYSTEM$LAST_CHANGE_COMMIT_TIME('mytable');

+--------------------------------+

SYSTEM$LAST_CHANGE_COMMIT_TIME
1661920053987000000
+--------------------------------+

SELECT SYSTEM$LAST_CHANGE_COMMIT_TIME('mytable');

+--------------------------------+

SYSTEM$LAST_CHANGE_COMMIT_TIME
1661920118648000000
+--------------------------------+

INSERT INTO mytable VALUES (2,100), (3,300);

SELECT SYSTEM$LAST_CHANGE_COMMIT_TIME('mytable');

+--------------------------------+

SYSTEM$LAST_CHANGE_COMMIT_TIME
1661920131893000000
+--------------------------------+