Adsense Ad

Wednesday 24 May 2017

Oracle: ORA-01471 Error Message

ORA-01471 Error Message

Learn the cause and how to resolve the ORA-01471 error message in Oracle.

Description

When you encounter an ORA-01471 error, the following error message will appear:
  • ORA-01471: cannot create a synonym with the same name as object

Cause

You tried to create a private synonym with the same name as the object that it is referencing.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

Select a synonym name for the private synonym that has not been already used by another object.
For example, if you had a table called suppliers defined as follows:
CREATE TABLE suppliers
( supplier_name varchar2(50),
  city varchar2(35)
);
Then executed the following statement:
CREATE SYNONYM suppliers
FOR suppliers;
You would receive the following error message:
Oracle PLSQL
You could correct this by selecting a unique name for the synonym that has not already been used by another object. For example:
CREATE SYNONYM suppliers_synonym
FOR suppliers;

No comments: