PLSQL Permissions vs SQL Permissions
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?