Object Type Definition

This is a translation reference to convert the Object Variant of the Oracle Create Type Statements (UDT's) to Snowflake

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

SnowConvert supports a translation for Object Type Definitions itself. However, their usages are still a work in progress.

Some parts in the output code are omitted for clarity reasons.

Description

Object Types define a structure of data similar to a record, with the added advantages of the member function definitions. Meaning that their data may be used along some behavior within the type.

For the translation of object types, the type definition is replaced by a Semi-structured Data Type and then it is expanded on any usages across the code. For tables this means replacing the column for a Variant, adding a View so that selects (and also Views) to the original table can still function.

CREATE TYPE <type name> AS OBJECT
( [{<type column definition> | type method definition } , ...]);

Sample Source Patterns

Inserts for Simple Type usage

The next data will be inserted inside the table before querying the select. Please note these Inserts currently need to be manually migrated into Snowflake.

Oracle

Snowflake

Simple Type usage

Oracle

Snowflake

Inserts for Nested Type Usage

These statements need to be placed between the table creation and the select statement to test the output.

Oracle

Snowflake

Nested Type Usage

Oracle

Snowflake

Known Issues

1. Migrated code output is not the same

The view statement is being changed unnecessarily, which makes the table no longer have the same behavior in the output code. There is a work item to fix this issue.

2. DML for User-defined Types is not being transformed

DML that interacts with elements that have User-defined types within them (like a table) are not being transformed. There is a work item to implement this in the future.

3. Create Type creation options are not supported

Currently, there is no known workaround for any of the creation options, for these reasons they are not taken into account when defining the type.

  1. SSC-EWI-0056: Create Type Not Supported.

  2. SSC-EWI-0062: Custom type usage changed to variant.

  3. SSC-EWI-0073: Pending Functional Equivalence Review.

Last updated