Tags¶
The Virtual DataPort allows you to assign tags to some of your elements.
CREATE TAG syntax
To create a tag use the statement CREATE TAG
or CREATE TAGS
.
CREATE [ OR REPLACE ] TAG <tag definition:tag>
CREATE [ OR REPLACE ] TAGS (<tag definition:tag> [, <tag definition:tag> ]*)
<tag definition> ::=
<name:identifier>
[ DESCRIPTION = <description:literal> ]
[ <assignations> ]
<assignations> ::=
ADD_TO (VIEWS (<view list:add_to_views>) COLUMNS (<column list:add_to_columns>))
REMOVE_FROM (VIEWS (<view list:add_to_views>) COLUMNS (<column list:add_to_columns>))
<view list> ::= [ <view identifier:view> [, <view identifier:view> ]* ]*
<column list> ::= [ <column identifier:column> [, <column identifier:column> ]* ]*
<view identifier> ::= <database name:identifier>.<view name:identifier>
<column identifier> ::= <database:identifier>.<view:identifier>.<column name:identifier>
Examples.
Creating a tag:
CREATE TAG "SSN" DESCRIPTION = 'Social Security Number';
Creating several tags with assignations:
CREATE TAGS ( "SSN" DESCRIPTION = 'Social Security Number' ADD_TO (VIEWS () COLUMNS (acme.employees.social_sec_number)) REMOVE_FROM (VIEWS () COLUMNS ()), "EMPLOYEES" DESCRIPTION = 'View with employees information' ADD_TO (VIEWS (acme.employees) COLUMNS ()) REMOVE_FROM (VIEWS () COLUMNS ()));
ALTER TAG syntax
To edit an existing tag, use ALTER TAG
.
ALTER TAG <name:identifier>
[ DESCRIPTION = <description:literal> ]
[ <assignations> ]
<assignations> ::= (see CREATE TAG syntax)
Example:
ALTER TAG "SSN"
DESCRIPTION = 'Social Security Number'
ADD_TO (VIEWS () COLUMNS (acme.employees_and_customers.social_sec_number))
REMOVE_FROM (VIEWS () COLUMNS (acme.employees.social_sec_number));
DROP TAG syntax
To remove an existing tag, use DROP TAG
or DROP TAGS
.
DROP TAG [ IF EXISTS ] <name:identifier> [ CASCADE ]
DROP TAGS [ IF EXISTS ] (<name:identifier> [ , <name:identifier> ]* ) [ CASCADE ]
Example:
DROP TAGS IF EXISTS ("SSN", "EMPLOYEES");