What wrong in the function(suggest me alternative also if any)
Date: 20 Sep 2001 23:02:39 -0700
Message-ID: <bfd4391d.0109202202.22113bb5_at_posting.google.com>
Hey please check out whats wrong in this function?
what iwant is to check whetehr a table exists or not.I'm connected as
user EXPLAIN goven DBA role.I want to fine that a table exitse in user
ECALS or not???
create or replace function check_for_table(t_name varchar2) return
integer is
It is working when i'm connected as ECALS.but when i connect as
EXPLAIN it does not work.
help me out.
tname varchar2(20);
n integer;
cursor c is select table_name from sys.all_tables where
table_name=t_name and owner='ECALS';
begin
n:=0;
dbms_output.put_line(t_name);
open c;
loop
dbms_output.put_line('hi1');
fetch c into tname;
exit when c%notfound;
n:=n+1;
dbms_output.put_line(tname);
end loop;
dbms_output.put_line('hi');
return(n);
exception
when others then
return(0);
end;
Received on Fri Sep 21 2001 - 08:02:39 CEST