Table doesnot exist error-
I have select access to table ( Route) which in a different schema (DRT).
When i do select from sqlplus
SQL> SELECT count(1) FROM DRT.Route
I got the count 10 rows.
When i wrote a anonymous block
Declare
X number;
Begin
select count(1) into X from DRT.Route
dbms_output.put_line('Counter:'|| X);
End;
==> OutPut is Counter: 10
When i do the same block in a procedure or function
Create or replace procedure
X number;
Begin
select count(1) into X from DRT.Route
dbms_output.put_line('Counter:'|| X);
End;
==> I got an error message
00942-- Table or view does not exist.
When i can select the data from sqlplus why the same select is giving
an error in procedure or function ??