Salesforce

GET_DDL Function: Support Added for Tags & Policies

« Go Back

Information

 
Summary
Last Modified DateJanuary 21, 2023
Article Body

This behavior change is in the 2022_08 bundle. In the 6.35 release, the bundle is disabled by default.

For the most up-to-date details about the version and date in which it will be enabled, as well as other release-related details, see the Behavior Change Log.


The GET_DDL function now supports tags and policies as follows:

  1. When a tag is set on a table, view, materialized view, the output of calling the GET_DDL function includes the tag assignments in the CREATE statement.
  2. When one or more tags are set on a schema or database, the output of calling the GET_DDL function includes the following statements to assign the tags:
    1. An ALTER DATABASE statement when the tag is set on the database.
    2. An ALTER DATABASE statement and an ALTER SCHEMA statement when the tag is set on both the database and schema.
    3. An ALTER SCHEMA statement when the tag is set on the schema.
  3. When a tag is created in a schema and this same schema is specified when calling the GET_DDL function, the output includes a CREATE OR REPLACE statement to generate the tag.

The same is true for a tag created in a database: specifying the database when calling the GET_DDL function includes the CREATE OR REPLACE statement to generate the tag.

  1. If a row access policy is set on a table or view or a masking policy is set on column, calling the GET_DDL function on the table or view adds the WITH keyword to indicate that the policy is set on the table, view, or column in the CREATE statement.

Note that if you were to manually create a table, specifying the WITH keyword is optional when setting a row access policy on the table or view or a masking policy on a column.

 


Ref: 603-850-861

TitleGET_DDL Function: Support Added for Tags & Policies
URL Nameget-ddl-tags-policies
Category 
Sub Category 
Article Record TypeRelease Notes

Powered by