Categories:

System Functions (System Information)

SYSTEM$STREAM_GET_TABLE_TIMESTAMP

Returns a timestamp indicating the transactional point when the stream contents were last consumed using a DML statement.

Syntax

SYSTEM$STREAM_GET_TABLE_TIMESTAMP('<stream_name>')

Arguments

stream_name

The 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>"'.

Examples

create table MYTABLE1 (id int);

create table MYTABLE2(id int);

create or replace stream MYSTREAM on table MYTABLE1;

insert into MYTABLE1 values (1);

-- consume the stream
begin;
insert into MYTABLE2 select id from MYSTREAM;
commit;

-- return the current offset for the stream
select system$stream_get_table_timestamp('MYSTREAM');