Oracle reported that DBLink synonym calling during Stored Procedure error: PLS-00201: must declare identifier, dblinkpls-00201

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.