Re: Dynamic SQL
Date: Mon, 31 Dec 2001 15:53:24 +0800
Message-ID: <a0p5mo$bc1$1_at_mail.cn99.com>
It's easy way.
select owner,table_name,count(column_name)column_count
from SYS.DBA_TAB_COLUMNS
group by owner,table_name
Thomas Stuefer <stuefer_at_halli-data.at> wrote in message
news:5uUW7.8$iq5.87126_at_news.salzburg-online.at...
> With dynamic SQL i wish to output all table-names in my schema with count
of
> rows, for example:
>
> TABLE_NAME COUNT_ROWS
> ------------------------------ ------------------
> BONUS 0
> DEPT 4
> EMP 14
> SALGRADE 5
>
>
> I know i can use "ANALYZE TABLE ... COMPUTE STATISTICS " and then "SELECT
> TABLE_NAME, NUM_ROWS FROM USER_TABLES", but i will use "SELECT COUNT(*)
FROM
> ..." in dynamic SQL with assign to a variable and then output this
variable
> with DBMS_OUTPUT.PUT_LINE. Is this possible ?
>
> Many thans for your help !!!
>
> Best regards,
> Tom
>
>
>
Received on Mon Dec 31 2001 - 08:53:24 CET