In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.