stored procedure with curson quering data dictonary view [message #224802] |
Thu, 15 March 2007 09:28 |
meggens
Messages: 57 Registered: February 2007 Location: Netherlands
|
Member |
|
|
Hi,
I don't get it....I do not have a lot of pl/sql development experiance please help:
this (anonymous block) works:
declare
cursor c1 is
select file_name from dba_data_files;
rec varchar2(255);
begin
open c1;
loop
fetch c1 into rec;
EXIT WHEN c1%NOTFOUND;
dbms_output.PUT_LINE(rec);
end loop;
close c1;
end;
and this doesn't:
create or replace
procedure test2 is
cursor c1 is
select file_name from dba_data_files;
rec varchar2(255);
begin
open c1;
loop
fetch c1 into rec;
EXIT WHEN c1%NOTFOUND;
dbms_output.PUT_LINE(rec);
end loop;
close c1;
end test2;
it returns me an error ora-00942 table or view doesn't exist.
I have select_catalog_role.....the anonymous block works.
When I use a table in my own schema it works fine.
Can anybody tell me what I'm missing?
regards,
Martin
|
|
|
|
|
|
|
Re: stored procedure with curson quering data dictonary view [message #224885 is a reply to message #224808] |
Thu, 15 March 2007 17:48 |
meggens
Messages: 57 Registered: February 2007 Location: Netherlands
|
Member |
|
|
anacedent wrote on Thu, 15 March 2007 15:47 | My car doesn't work.
Tell me how to make it go.
A clueless post deserves a contentless response.
|
I think I was clear enough by showing the first example is an anonymous pl/sql block and the second one a stored procedure.
anyway thanks for your respons.
|
|
|