Search code examples
sqloracle-databasesynonym

is it possible to update tables using synonyms


I have synonyms in my database which is refering one table in different DB. Is it possible to update the table using synonymn name?


Solution

  • Yes, you can update by using below method( for oracle db ):

    create public database link db2 connect to myschema using 'abc-scan.mycompany.com.tr:1521/db2.mycompany.com.tr';
    create synonym syn_table1 for table1@db2;
    update syn_table1 set col1=value1