Dabatase: Oracle
User: Not dba
In my oracle database, im able to do the following:
SELECT * FROM ALL_SYNONYMS
But when i do it in pl/sql, it is able to compile and execute, but the dbms.putline prints nothing:
CREATE PROCEDURE PROCEDURE_1 AS
strName VARCHAR2(50);
CURSOR C_NAME IS SELECT SYNONYM_NAME FROM ALL_SYNONYMS WHERE TABLE_OWNER = 'USER1';
BEGIN
FOR R_NAME in C_NAME
LOOP
strName := R_NAME.SYNONYM_NAME;
dbms_output.put_line(strName); <-----
END LOOP;
END PROCEDURE_1
Do we need to grant any role to a non-dba user for All_Synonyms table?