Create Synonym
In this page you could find information about Synonyms.
Create Synonym
Synonyms are not supported in Snowflake. The references to the Synonyms will be changed for the original Object.
-- Oracle
CREATE OR REPLACE SYNONYM B.TABLITA_SYNONYM FOR TABLITA;
-- Snowlake
-- ** MSC-WARNING - MSCEWI3025 - SYNONYMS NOT SUPPORTED IN SNOWFLAKE BUT REFERENCES TO THIS SYNONYM WERE CHANGED BY THE ORIGINAL OBJECT NAME. **
--CREATE OR REPLACE SYNONYM B.TABLITA_SYNONYM FOR TABLITA;Example 1: Synonym that refers to a table.
Oracle source code:
CREATE TABLE TABLITA
(
COLUMN1 NUMBER
);
CREATE OR REPLACE SYNONYM B.TABLITA_SYNONYM FOR TABLITA;
SELECT * FROM B.TABLITA_SYNONYM WHERE B.TABLITA_SYNONYM.COLUMN1 = 20;Snowflake migrated code: you'll notice that the SELECT originally refers to a synonym, but now it refers to the table that points the synonym.
Example 2: Synonym that refers to another synonym.
Oracle source code:
Snowflake migrated code: you'll notice that originally the SELECT , UPDATE, INSERT refers to a synonym, and now it refers to the atomic object, which is a table.
Example 3: Synonym that refers to a view
Oracle Source Code
Snowflake migrated code: you'll notice that the SELECT originally refers to a synonym, and now it refers to the atomic objects, which is a view.
Synonyms transformation can be enabled or disabled from the UI settings or through a flag in the CLI.
Last updated
Was this helpful?