Im trying to write a procedure that will return the rowcount of any table whose name is supplied as avariable to the function. I know it is possible to include a variable in the where clause of a cusor but I seem to have problems including a variable in the from clause:
create or replace procedure RowComparison is
cursor tableName_cur is
select table_name from user_tables;
FETCH tableName_cur into tableName_rec;
EXIT WHEN tableName_cur%NOTFOUND;
select count(*) into raph1count from tableName_rec. table_name;
I get the same problem if I try to rewrite this using an explicit cursor.
The error I get is this:
PLS-00356: 'TABLENAME_REC.TABLE_NAME' must name a table to which the user has access
Can anyone help?
Your question has already been answered in a duplicate thread http://www.dbasupport.com/forums/sho...threadid=14749 . Please refrain from posting the same question in multiple forums in the future.
Click Here to Expand Forum to Full Width