Command Line Interface
Integrate SnowConvert for Oracle into your CI/CD process with the CLI version of the tool.
To execute a conversion with the SnowConvert CLI you have to have an active license. In the section below we show you how to install a license key.
There are several Command Line Arguments documented below, but the main ones are
-i
for the input folder and -o
for the output folder.To install a license key just execute SnowConvert CLI with the
-l
argument and the license key.$: snowct-oracle -l P-ABCD-12345-EFGHI
To see a summary with the current license status just execute SnowConvert CLI with just the
-l
and no other arguments.$: snowct-oracle -l
To migrate a folder just execute SnowConvert CLI program with the
-i <INPUT FOLDER>
and -o <OUTPUT FOLDER>
arguments.$: snowct-oracle -i ~/Documents/Workspace/Code -o ~/Documents/Workspace/Output
The path to the folder or file containing the input source code.
The path to the output folder where the converted code and reports will be stored.
Flag to indicate whether or not to generate only assessment files. By default, it is set to false.
Flags were used to indicate whether the migration tool should migrate stored procedures to Snowflake Scripting.
--PLTargetLanguage
The encoding code page number is used for parsing the source files. We only accept encodings supported by .NET Core. Here are the ones supported at the moment:
Code Page | Name | Display Name |
1200 | utf-16 | Unicode |
1201 | unicodeFFFE | Unicode (Big endian) |
12000 | utf-32 | Unicode (UTF-32) |
12001 | utf-32BE | Unicode (UTF-32 Big endian) |
20127 | us-ascii | US-ASCII |
28591 | iso-8859-1 | Western European (ISO) |
65000 | utf-7 | Unicode (UTF-7). Not available in .NET 5 |
65001 | utf-8 | Unicode (UTF-8). Default encoding |
Flag to indicate if the user wants to comment out objects that have missing dependencies.
The string value specifies the target language to convert Stored procedures and some functions. Currently supported are: SnowScript and JavaScript.
The default value is set to SnowScript.
The string value specifies the custom schema name to apply. If not specified, either PUBLIC or the original database name will be used. Example: DB1.MyCustomSchema.Table1.
If you provide this parameter with a schema name NONE
--customschema none
, the converted code will keep the original schema defined in the source code.The string value specifies the custom database name to apply. Example: MyCustomDB.PUBLIC.Table1.
--useExistingNameQualification
This flag must be used in conjunction with the
-d
or -s
parameters. When used, it preserves the existing name qualification from the input code when previous parameters are used.
Let's take a look at this example where -s newSchema
was included:Input
Default
Using --useExistingNameQualification
SELECT * FROM mySchema.myObject;
SELECT * FROM newSchema.myObject;
SELECT * FROM mySchema.myObject;
The same applies to databases.
Shows the license information. If it's followed by a license key, it will attempt to download and install such a license. For example:
- Showing license status
snowct-oracle -l
- Installing a license
snowct-oracle -l 12345-ASDFG-67890
Show license terms information.
Display the help information.
Display the CLI and Code Processor version information.
Flag to indicate whether SnowConvert should migrate the procedures to Javascript and Python. By default, it is set to false.
Flag to indicate whether or not Synonyms should be transformed. By default, it's set to true.
Flag to indicate whether or not the Packages should be transformed to new Schemas.
Please check the naming of the procedure enabling and disabling the flag:
// Oracle Input
CREATE OR REPLACE PACKAGE emp_mgmt AS
PROCEDURE remove_emp (employee_id NUMBER );
END emp_mgmt;
CREATE OR REPLACE PACKAGE BODY emp_mgmt AS
PROCEDURE remove_emp (employee_id NUMBER) IS
BEGIN
DELETE FROM employees
WHERE employees.employee_id = remove_emp.employee_id;
tot_emps := tot_emps - 1;
END;
END emp_mgmt;
// Transformation by default
CREATE SCHEMA IF NOT EXISTS emp_mgmt;
...
CREATE OR REPLACE PROCEDURE emp_mgmt.remove_emp (employee_id FLOAT)
...
// Transformation with disablePackagesAsSchemas flag
CREATE OR REPLACE PROCEDURE EMP_MGMT_REMOVE_EMP (employee_id FLOAT)
...
Flag to indicate whether Outer Joins should be transformed to only ANSI syntax.
Flag to indicate whether SnowConvert should migrate the procedures to Snowscript. By default, it is set to true.
This is a deprecated flag, it will be removed soon.
Flag to indicate whether
SYSDATE
should be transformed to CURRENT_DATE
or CURRENT_TIMESTAMP
. This will also affect all DATE
columns that will be transformed to TIMESTAMP
.// Oracle Input
CREATE TABLE DATE_TABLE(
DATE_COL DATE
);
SELECT SYSDATE FROM DUAL;
// Transformation by default
CREATE OR REPLACE TABLE PUBLIC.DATE_TABLE (
DATE_COL TIMESTAMP /*** MSC-WARNING - MSCEWI3060 - DEFAULT VALUE FOR SYSDATE IS CURRENT_TIMESTAMP. COLUMN WAS TRANSFORMED TO TIMESTAMP TO PRESERVE INFORMATION. ***/
);
SELECT
CURRENT_TIMESTAMP
FROM DUAL;
// Transformation with --disableDateAsTimestamp flag
CREATE OR REPLACE TABLE PUBLIC.DATE_TABLE (
DATE_COL DATE
);
SELECT
CURRENT_DATE
FROM DUAL;
Learn more about how you can get access to the SnowConvert for Oracle Command Line Interface tool by filling out the form on our Snowflake Migrations Info page.
Flag to indicate whether the input code should be processed before parsing and transformation.
Last modified 3mo ago