How can you check which package a table is in using PL/SQL?

To check which schema a table is in, you can use the following SQL statement to query the DBA_OBJECTS view:

SELECT OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS
FROM DBA_OBJECTS
WHERE OBJECT_TYPE = 'PACKAGE'
AND OBJECT_NAME IN (
    SELECT OBJECT_NAME
    FROM DBA_OBJECTS
    WHERE OBJECT_TYPE = 'TABLE'
    AND OBJECT_NAME = 'YOUR_TABLE_NAME'
);

Replace “YOUR_TABLE_NAME” with the name of the table you want to search. This query will return the owner, package name, object type, and status of all packages containing that table.

广告
Closing in 10 seconds
bannerAds