PL/SQL (MOSC)

MOSC Banner

ORA-00904 for execute immediate string

in PL/SQL (MOSC) 4 commentsAnswered

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 );

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center