PL/SQL (MOSC)

MOSC Banner

PLSQL Permissions vs SQL Permissions

edited May 6, 2010 9:44AM in PL/SQL (MOSC) 5 commentsAnswered
 Hi,

I recently created a stored procedure that was to return 26 rows. I know this because I ran the query in SQL. When I run the same query in the procedure I get 179 rows. The query was as follows:

In the procedure c_cursor to delete is SELECT ROWNUM
      ,synonym_name
FROM   all_synonyms
WHERE  table_name NOT IN (
                          SELECT object_name
                          FROM   all_objects
                          WHERE  object_type <> 'SYNONYM'
                          AND    owner = 'WMISEXT')
AND    owner = 'PUBLIC'
AND    table_owner = 'WMISEXT';

When running this in a procedure it returns 179 rows. When running as a standalone query on 26. Also, when I run this as an anonymous block I also get 26 rows. I was able to fix this by granting select to the schema that was running the procedure. Why would a procedure behave differently than an anonymous block or straight query?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center