Oracle reported that DBLink synonym calling during Stored Procedure error: PLS-00201: must declare identifier, dblinkpls-00201
A stored procedure needs to be written a few days ago to access the field of the remote database, so a dbLink is created and a synonym is created:
Create public database link orcl @ dbc connect to orcl identified by orcl USING 'orcl '; create synonym mtb FOR mytable @ orcl @ dbc;
Here, we use orcl @ bdc as the dblink name to set global_names = true.
Create a stored procedure and call this synonym:
V_result mtb. sid % type;
Error: PLS-00201: must declare the identifier 'mtb. Sid ';
After multiple searches, it is indeed because of identity reasons. You must grant permissions to the accessed database. The specific code is as follows:
Grant select on mytable to orcl; -- orcl is the user name
Then the compilation is passed.
Summary
The above is a small series to introduce you to the Oracle report Stored Procedure Call DBLink synonym error: PLS-00201: must declare the identifier, hope to help everyone, if you have any questions, please leave a message and the editor will reply to you in time. Thank you very much for your support for the help House website!