0

I tried below query :

select table_name, to_number(extractvalue(xmltype(dbms_xmlgen.getxml(‘select count(*) c from ‘||table_name)),’/ROWSET/ROW/C’)) as count from user_tables

But, I am getting following error.

ORA-00911: invalid character 00911. 00000 - "invalid character" *Cause: identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q'#...#') cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual. *Action: Error at Line: 76 Column: 52

I am new to oracle. So, Can anyone please let me know the possible way to get the exact row count of all the tables in particular schema.

P.S. I tried below query for all_tables. But, I got to know that the below query is based on the statistics and it may not give exact result.

select owner, table_name, num_rows,LAST_ANALYZED from all_tables where OWNER = 'XYZ' and TABLE_NAME = 'APPLICATION' order by table_name asc;

Ash Atre
  • 305
  • 4
  • 17
  • It is not a duplicate question. I tried those answers as well. But,I don't want to use All_table because it is not giving me exact count. It gives counts based on LAST_ANALYZED – Ash Atre Oct 07 '16 at 16:59
  • Do you have a `table_name` in `user_tables` that starts with a character other than letters, numbers, $, #, or _? If you have case-sensitive identifiers (shudder) then you'd need to double quote the table name. – Justin Cave Oct 07 '16 at 17:24
  • Have you tried the 2nd answer? http://stackoverflow.com/a/10705088/6827719 that looks like what you're looking for – SergeiBednar Oct 07 '16 at 19:37

0 Answers0