In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, I wrote a stored procedure that needs to copy the data of the tables under other users to the target table through dblink. As a result, when I visit the tables of other systems, there are always problems in the stored procedure and the answer is found in Stack Overflow.
In stored procedures, functions, and definers-rights packages, roles (such as SELECT_CATALOG_ROLE) are disabled. Therefore, such a PL/SQL program can only fetch metadata for objects in its own schema. If you want to write a PL/SQL program that fetches metadata for objects in a different schema (based on the invoker's possession of SELECT_CATALOG_ROLE), you must make the program invokers-rights.
To do this, you must add authid to your procedure.
Create procedure tests authid CURRENT_USER is l_foo clob;beginselectregexp_replace (dbms_metadata.get_ddl ('USER',' SCOTT', null) | | dbms_metadata.GET_GRANTED_DDL ('SYSTEM_GRANT',' SCOTT') | | dbms_metadata.GET_GRANTED_DDL ('OBJECT_GRANT',' SCOTT') | | dbms_metadata.GET_GRANTED_DDL ('ROLE_GRANT',' SCOTT'),'"| | chr (10),'";'| chr (10) into l_foo from dual End;/SQL > EXEC tests PL/SQL procedure successfully completed
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.