

He also signed the Articles of Confederation, and used his influence to ensure that Massachusetts ratified the United States Constitution in 1788.īefore the American Revolution, Hancock was one of the wealthiest men in the Thirteen Colonies, having inherited a profitable mercantile business from his uncle. He is remembered for his large and stylish signature on the United States Declaration of Independence, so much so that the term John Hancock or Hancock has become a nickname in the United States for one's signature. He served as president of the Second Continental Congress and was the first and third Governor of the Commonwealth of Massachusetts. John Hancock (Janu – October 8, 1793) was an American Founding Father, merchant, statesman, and prominent Patriot of the American Revolution. Hancock Manor, Boston, Massachusetts, U.S. (partly Thomas Gage as colonial governor)Ĥth and 13th President of the Continental Congressġst President of Massachusetts Provincial Congressīraintree, Province of Massachusetts Bay, British America (now Quincy) Here the customization for your problem BEGINĮXECUTE IMMEDIATE 'CREATE or REPLACE SYNONYM ETKS_PR_RW.SQ_CLDOS_ATCHMNT_ID FOR CLDOS_ONLINE_DBA.SQ_CLDOS_ATCHMNT_ID' ĭbms_output.Portrait by John Singleton Copley, c. Next_row.object_name|| ' for '|| src_schema|| '.'||ĭbms_output.Put_line('ERROR WHILE CREATING SYNONYM FOR: ' Target_schema VARCHAR2(256) := 'EMPIK_PORTAL_BETA_1' ĮXECUTE IMMEDIATE 'CREATE or REPLACE SYNONYM '|| target_schema|| '.' Or you can create pl/sql code using these tables desc dba_synonyms I think if you removed the OR REPLACE keyword it will prompt you that it exist All objects will be upper-cased automatically so you don't need the ". Oracle can have cased objects, but it is very, very rarely worth the hassle. On a slightly separate not please do not quote your object names. DDL has to be done inside execute immediate in a block.Įxecute immediate 'CREATE OR REPLACE SYNONYM ETKS_PR_RW.SQ_CLDOS_ATCHMNT_IDįOR CLDOS_ONLINE_DBA.SQ_CLDOS_ATCHMNT_ID' If you want to combine these into a single block then you can do something like this: declare select *Īnd synonym_name = 'SQ_CLDOS_ATCHMNT_ID' Query the data-dictionary, as you're in multiple schemas all_synonyms seems like the best bet. The statement will throw an error if the synonym already exists and won't get over-written. However, if you do want to there are a couple of options: You should always know what all of your objects are and where the synonyms point.

If your database is organised well this shouldn't happen. The only reason to be wary of using replace is if you might have a different synonym with the same name. You will over-write whatever synonym existed with the previous name.

As you're using the replace keyword there is no need to check whether the synonym exists first.
