Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

invalid character ora 00911

258794Jan 5 2007 — edited Jan 8 2007
Good Morning,

Would someone please look at this code? I keep getting this error above on the EXECUTE IMMEDIATE line. The longer I stare at it the goofier it gets. I had tried quotes in all different combinations on this line and nothing works.

The ora error invalid character reads: identifiers may not start with any ASCII character other than letters and numbers,$#_ are also allowed after the first character. Identifiers enclosed by double quotes may contain any charater other than a double quote. Alternative quotes (q'#...#') cannot use spaces, tabs or carriage returns as delimiters.

Thanks for your help in this matter in advance.

al

DECLARE

CURSOR c1 IS select owner, table_name from dba_tables
where owner like 'AAB%'
and table_name like 'BBC%';

sql_stmnt varchar2(4000);

cnt_val number;

BEGIN

FOR c1_rec IN c1 LOOP
sql_stmnt := 'select count(*) from '|| c1_rec.owner||'.'||c1_rec.table_name;
EXECUTE IMMEDIATE sql_stmnt INTO cnt_val;

DBMS_OUTPUT.PUT_LINE(c1_rec.table_name||' has '||cnt_val||' number of rows');

END LOOP;
END;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2007
Added on Jan 5 2007
11 comments
1,064 views