SQL Language (MOSC)

MOSC Banner

generate dynamically the number of records per table in a schema

edited Aug 23, 2012 7:02PM in SQL Language (MOSC) 2 commentsAnswered

Hi,

I  was wondering if there is  a way to generate dynamically the number of records per table for a given scehma.

I need to get the input in the format :

table name , row_count

xxx               100

yyy               200

...................

....................

I have found in various forums that xml query can be used for that . I have used the below successfully  to pick number of records in each of the table's partition, but I am wondering if there is another way without using xml:

INSERT INTO xxx(PARTITION_NAME,ROWS_IN_SOURCE)SELECT

PARTITION_NAME,to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) X from '

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