Oracle - User-Defined Types¶
Description¶
User-defined data types use Oracle built-in data types and other user-defined data types as the building blocks of object types that model the structure and behavior of data in applications. The sections that follow describe the various categories of user-defined types. (Oracle SQL Language Reference User-defined Data Types)
Warning
Snowflake does not have any support for User-defined Types. This page is meant to be a summary of Oracle’s features. For the current status of User-defined Types in the tool please refer to the Create Type Statement Page and its subpages.
Object Types¶
Note
Partial translation is offered for Object Types, for more information on this, please refer to the next section: Object type definition
REF Data Types¶
Danger
Ref Data Types are not recognized, and are instead shown as unrecognized “User-defined Functions”. For more information about them, please read the REF Data Types subpage.
An object identifier (represented by the keyword
OID) uniquely identifies an object and enables you to reference the object from other objects or from relational tables. A data type category calledREFrepresents such references. AREFdata type is a container for an object identifier.REFvalues are pointers to objects. (Oracle SQL Language Reference REF Data Types)
Varrays¶
Warning
These elements are only recognized but no translation is offered for them, for more information on this, please refer to the next section: Array type definition
Nested Tables¶
Warning
These elements are only recognized but no translation is offered for them since there are no known workarounds for them, for more information on this, please refer to the next section:Nested table type definition
Known Issues¶
1. DML usages for Object Types are not being transformed¶
As of now, only DDL definitions that use User-Defined Types are being transformed into Variant. This means that any Inserts, Updates or Deletes using User-defined Types are not being transformed and need to be manually transformed. There is no EWI for this but there is a work item to add this corresponding EWI.
2. Nested Table types are not being transformed¶
There is no known workaround for implementing Nested Tables, for this reason only recognition is offered for these elements.
3. Array types are not being transformed¶
For now these elements are only recognized. A known workaround exists and there is a work item to implement them.
4. REF Data Types are not supported, but there is no EWI related to them¶
They are not supported, and instead are reported as an unknown User-Defined Function, but there is a work item to add this corresponding EWI.
Related EWIs¶
No related EWIs.
REF Data Types¶
Note
Some parts in the output code are omitted for clarity reasons.
Description¶
An object identifier (represented by the keyword
OID) uniquely identifies an object and enables you to reference the object from other objects or relational tables. A data type category calledREFrepresents such references. AREFdata type is a container for an object identifier.REFvalues are pointers to objects. (Oracle SQL Language Reference REF Data Types)
REF Data types are not supported in Snowflake, and there is no current workaround to implement a similar component.
As of now, they are currently being recognized as user-defined functions and “DANGLING” clauses are not being recognized. Finally, the OID clause in view is being removed, as there is no workaround for them.
Sample Source Patterns¶
Types and Tables for References¶
Please consider the following types, tables, inserts and view. They will be used for the next pattern section.
Oracle¶
Selects and Views using REFs¶
Oracle¶
Result with danglings¶
| CUSTOMER_REFERENCE.CUST_FIRST_NAME | EMAIL_REF.EMAIL |
|---|---|
| First Name 1 | abc@def.com |
| First Name 2 |
Result with no danglings¶
| CUSTOMER_REFERENCE.CUST_FIRST_NAME | EMAIL_REF.EMAIL |
|---|---|
| First Name 1 | abc@def.com |
Snowflake¶
Known Issues¶
1. REF and MAKE_REF are not being recognized
Instead they are currently being marked as user-defined functions.
2. DANGLING clause is not being recognized
DANGLING clauses are causing parsing errors.
3. OID Clauses in view are not supported, but there is no EWI related to them¶
The OID clause is not supported by either the tool, nor Snowflake but there should be an EWI related to them.
Related EWIs¶
- SSC-EWI-0001: Unrecognized token on the line of the source code.
- SSC-EWI-0073: Pending Functional Equivalence Review.
- SSC-FDM-0001: Views selecting all columns from a single table are not required in Snowflake.