Introduction
Welcome to Snowflake SnowConvert for Oracle. Let us be your guide on the road to a successful migration.
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
What is SnowConvert for Oracle?
SnowConvert is a software that understands Oracle SQL and PL/SQL, and performs the following conversions:
Oracle SQL to Snowflake SQL
Oracle PL/SQL to:
JavaScript embedded in Snowflake SQL
SnowConvert Terminology
Before we get lost in the magic of these code conversions, here are a few terms/definitions so you know what we mean when we start dropping them all over the documentation:
SQL (Structured Query Language): The standard language for storing, manipulating, and retrieving data in most modern database architectures.
PL/SQL: Procedural Language for SQL. This was created by Oracle, and is still used by Oracle as the scripting language for stored procedures and functions in Oracle.
SnowConvert: The software that converts securely and automatically your Oracle files to the Snowflake cloud data platform.
Conversion rule or transformation rule: Rules that allow SnowConvert to convert from a portion of source code and determine the expected target code.
Parse: Parse or parsing is an initial process done by SnowConvert to understand the source code, and build up an internal data structure to process the conversion rules.
Let's dive in to some of the code conversions that Snowflake SnowConvert can perform.
Code Conversions
Oracle SQL to Snowflake SQL
SnowConvert for Oracle takes in Oracle source code in SQL and converts the Data Definition Language (DDL), Data Manipulation Language (DML), and functions in the source code to the corresponding SQL in Snowflake SQL.
Example
Here is an example of the conversion of a simple CREATE TABLE
statement.
The source code:
The migrated Snowflake SQL code:
In this converted SQL you will notice that we are converting many things. A few highlights:
Adding
PUBLIC
Schema by default for all the Table and view names if the user doesn't specify one (see how to specify a Schema).CREATE TABLE
toCREATE OR REPLACE TABLE
Data Type Conversions:
LONG
toVARCHAR
CLOB
toVARCHAR
ROWID
toVARCHAR
NVARCHAR2
toVARCHAR
RAW
toBINARY
Data Type Attributes:
GENERATED ALWAYS AS (COL1 * COL2) VIRTUAL
toAS (COL1 * COL2)
For more information about data types and their equivalent: Data Types. More examples can be found in the rest of the documentation.
Oracle PL/SQL
SnowConvert takes Oracle stored procedures and functions (PL/SQL) and converts them to either Snowflake Scripting or JavaScript embedded into Snowflake SQL. Oracle CREATE PROCEDURE
and REPLACE PROCEDURE
syntax is replaced by Snowflake CREATE OR REPLACE PROCEDURE
syntax.
Example
Here is an example of the conversion of a simple CREATE PROCEDURE
in Oracle that does an insert into a table used for logging.
This example will be used for both Snowflake Scripting and JavaScript.
To Snowflake Scripting
Snowflake Scripting works as an extension to Snowflake SQL, it adds support for procedural logic and this allow us to create Stored Procedures and replicate similar behaviours and statements of Oracle PL/SQL.
Migrated Example
To JavaScript
JavaScript is called as a scripting language, all inner statements are converted to JavaScript. If you want to understand better the JavaScript API check this documentation.
Migrated Example
In this converted SQL you will notice that we have converted to a new language (JavaScript) embedded into Snowflake SQL. There are more than a few highlights, but suffice it to say that this documentation has all the essentials to understand this kind of conversion.
The line that states // ... Necessary SnowConvert Helpers are inserted here ...
will actually have the SnowConvert JavaScript Helpers. They can be lengthy, so they are removed from this first example.
And that's it! Snowflake SnowConvert takes the pain and frustration out of changing data platforms. Learn more about getting started with SnowConvert for Oracle on the next page.
Last updated