Synonyms report "table and view does not exist" in stored procedure call

Synonyms are created, and direct query is normal, but when the stored procedure is called, it will report ""Tables and views do not exist"", because "To access public synonyms in the stored procedure, you must directly authorize the user, not through role authorization. ".

See http://blog.csdn.net/linminqin/article/details/6671785.

For example, I want to call the ca table in the stored procedure of the test user. After the test creates the synonym of ca, I need to grant all on the synonym table name to public.

 

Other:

If you create a lot of synonyms, it is very troublesome to assign each of them, you can use sql query, and then copy and paste to run.

select 'grant select on '||SYNONYM_NAME || ' to PUBLIC ' from dba_synonyms WHERE OWNER='TEST'. Copy the result and run it.

You can use all when granting permissions, and you only need to use select for queries, so you can only give select

See http://blog.itpub.net/77580/viewspace-212827/

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326822240&siteId=291194637