ORA-00904 for execute immediate string
Hello,
In oracle ee 19.20 running on solaris 11.4 64 bit, I've got an anonymous block of plsql. The sql is run by the system db user.
There is a loop based on the top 50 tables by size in a single schema. I've attached the complete code in file redacted_dsc.sql.txt.
This is issue I have is in the loop:
open Top50Tables;
loop
fetch Top50Tables into lv_TableName,SegmentSize;
exit when Top50Tables%NOTFOUND;
RunTableSql := 'select count(1) from <schema_name_redacted>.'||lv_TableName;
execute immediate RunTableSql into NumRows;
dbms_output.put_line('' || lv_TableName || '' || ',' || SegmentSize || ',' || NumRows );