Hi All,
I am on Banner
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
My Database OraDB has 5 schemas,
S1,S2,S3,S4,S5
Where S1 has table T1 whose select grant is given to S2,S3 and S4 schema.
Where as S5 Schema has SELECT ANY TABLE grant.
I got a scenario where I am compiling or using (execute immediate) to access Table T1 of S1 schema.
But I got error of Table or view doensn't exists.
So what I did to verify whether the syntax is correct, I've printed SQL_Variable which is holding query before its execution in EXECUTE IMMEDIATE.
This printed SQL execute find in TOAD or in SQLPLUS but when the same variable is executing inside EXECUTE IMMEDIATE I got error
Table or view doesn't exist.
To Keep crosscheck on this I ran
Executed SQL : {code } select column_name from S1.T1 {code } in both TOAD and SQLPLUS it ran succesfully but when I placed it inside package it threw error of table or view doesn't exists.