CREATE_TAG stored procedure

The CREATE_TAG stored procedure is used to created a tag for a Datalake Iceberg table that references one of the table’s snapshots.

A list of snapshots created for a table can be queried using the TABLE_SNAPSHOTS table function.

The tags and branches defined for a table can be queried using the TABLE_SNAPSHOT_REFS table function.

Authorization

EXECUTE is granted to the DASHDB_ENTERPRISE_ADMIN role.

Syntax

Read syntax diagramSkip visual syntax diagramCREATE_TAG(schema_name ,table_name,tag,snapshot_id,retain)

The schema is SYSHADOOP.

Description

schema_name
An input argument of type VARCHAR(128) containing the name of the schema. This is a required parameter which identifies the schema name. Although this can be specified using the named parameter syntax, it is not recommended.
table_name
An input argument of type VARCHAR(128) containing the name of the table. This is a required parameter which references the table which will be impacted by the procedure. Although this can be specified using the named parameter syntax, it is not recommended.
tag
An input parameter of type VARCHAR(32672) which specifies the tag name to be created for the specified snapshot. This parameter is required.
snapshot_id
An input argument of type VARCHAR(20) that identifies the table snapshot the tag is to be created for. This parameter is optional. If not specified, the tag is created for the current snapshot.
retain
An input argument of type VARCHAR(20) that identifies the maximum reference age retention property in milliseconds for the tag. This parameter is optional.

Output

A result set with two columns named STATUS_CODE and STATUS_MESSAGE. These columns contain values indicating the success or failure of the procedure. If the procedure succeeds, the STATUS_CODE is set to 0 and the STATUS_MESSAGE includes information related to the procedure results. If the procedure failed, the STATUS_CODE is set to -1 and the STATUS_MESSAGE includes an explanation indicating why it failed.

Example

CALL CREATE_TAG('SAMPLE', 'EMPLOYEE', 'release_one')                                                                                                                   

  Result set 1

  --------------

  STATUS_CODE STATUS_MESSAGE                                                                   

  ----------- ---------------------------------------------------------------------------------

            0 Tag release_one created for snapshot 8247532104379958597 on table SAMPLE.EMPLOYEE

  1 record(s) selected.

  Return Status = 0