SnowConvert AI - Oracle Conversion Settings¶
General Conversion Settings¶
Object Conversion¶
Transform Synonyms: Flag to indicate whether or not Synonyms should be transformed. By default, it’s set to true.
Transform Packages to new Schemas: 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:
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;
Output Default
CREATE SCHEMA IF NOT EXISTS emp_mgmt
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
;
CREATE OR REPLACE PROCEDURE emp_mgmt.remove_emp (employee_id NUMBER(38, 18))
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
BEGIN
DELETE FROM
employees
WHERE employees.employee_id = remove_emp.employee_id;
tot_emps :=
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '-' MAY NOT BEHAVE CORRECTLY BETWEEN unknown AND Number ***/!!!
tot_emps - 1;
END;
$$;
Output with param disablePackagesAsSchemas
-- Additional Params: --disablePackagesAsSchemas
CREATE OR REPLACE PROCEDURE EMP_MGMT_REMOVE_EMP (employee_id NUMBER(38, 18))
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
BEGIN
DELETE FROM
employees
WHERE employees.employee_id = remove_emp.employee_id;
tot_emps :=
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '-' MAY NOT BEHAVE CORRECTLY BETWEEN unknown AND Number ***/!!!
tot_emps - 1;
END;
$$;
Transform Date as Timestamp:
Flag to indicate whether SYSDATE
should be transformed into CURRENT_DATE
or CURRENT_TIMESTAMP
. This will also affect all DATE
columns that will be transformed to TIMESTAMP
.
Input
CREATE TABLE DATE_TABLE(
DATE_COL DATE
);
SELECT SYSDATE FROM DUAL;
Output Default
CREATE OR REPLACE TABLE DATE_TABLE (
DATE_COL TIMESTAMP /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
;
SELECT
CURRENT_TIMESTAMP()
FROM DUAL;
Output with param disableDateAsTimestamp
-- Additional Params: --disableDateAsTimestamp
CREATE OR REPLACE TABLE DATE_TABLE (
DATE_COL DATE /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
;
SELECT
CURRENT_DATE()
FROM DUAL;
Transform OUTER JOINS to ANSI Syntax: Flag to indicate whether Outer Joins should be transformed to only ANSI syntax.
Data Conversion Types: You can upload a JSON file below to define specific data types considering data type origin and column name.
General Result Tab¶
Comment objects with missing dependencies: This flag indicates whether the user wants to comment on nodes with missing dependencies.
Set encoding of the input files: Check General Conversion Settings for more details.
Note
To review the Settings that apply to all supported languages, go to the following article.
DB Objects Names Settings¶
Schema: The string value specifies the custom schema name to apply. If not specified, the original database name will be used. Example: DB1.myCustomSchema.Table1.
Database: The string value specifies the custom database name to apply. Example: MyCustomDB.PUBLIC.Table1.
Default: None of the above settings will be used in the object names.
Prepare Code Settings¶
Description¶
Prepare my code: Flag to indicate whether the input code should be processed before parsing and transformation. This can be useful to improve the parsing process. By default, it’s set to FALSE.
Splits the input code top-level objects into multiple files. The containing folders would be organized as follows:
Copy
└───A new folder named ''[input_folder_name]_Processed''
└───Top-level object type
└───Schema name
Example¶
Input¶
├───in
│ DDL_Packages.sql
│ DDL_Procedures.sql
│ DDL_Tables.sql
Output¶
Assume that the name of the files is the name of the top-level objects in the input files.
├───in_Processed
├───package
│ └───MY_SCHEMA
│ MY_FIRST_PACKAGE.sql
│ ANOTHER_PACKAGE.sql
│
├───procedure
│ └───MY_SCHEMA
│ A_PROCEDURE.sql
│ ANOTHER_PROCEDURE.sql
│ YET_ANOTHER_PROCEDURE.sql
│
└───table
└───MY_SCHEMA
MY_TABLE.sql
ADDITIONAL_TABLE.sql
THIRD_TABLE.sql
Inside the “schema name” folder, there should be as many files as top-level objects in the input code. Also, it is possible to have copies of some files when multiple same-type top-level objects have the same name. In this case, the file names will be enumerated in ascending order.
Requirements ¶
To identify top-level objects, a tag must be included in a comment before their declaration. Our Extraction scripts generate these tags.
The tag should follow the next format:
<sc-top_level_object_type>top_level_object_name</sc-top_level_object_type>
You can follow the next example:
/* <sc-table> MY_SCHEMA.MY_TABLE</sc-table> */
CREATE TABLE "MY_SCHEMA"."MY_TABLE" (
"MY_COLUMN" VARCHAR2(128)
) ;
Conversion Rate Settings¶
On this page, you can choose whether the successfully converted code percentage is calculated using lines of code or using the total number of characters. The character conversion rate is the default option. You can read the entire rate documentation on thedocumentation page.
Stored Procedures Target Languages Settings¶
On this page, you can choose whether stored procedures are migrated to JavaScript embedded in Snow SQL, or to Snowflake Scripting. The default option is Snowflake Scripting.
Reset Settings: The reset settings option appears on every page. If you’ve made changes, you can reset SnowConvert AI to its original default settings.