REPOST: Re: Dynamic SQL

From: James Xu <xu_at_shanghai.samsung.com>
Date: Mon, 31 Dec 2001 15:53:24 +0800
Message-ID: <6$--$$-$-%$_$_%%$$_at_news.noc.cabal.int>


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

  • WAS CANCELLED BY =======: Path: news.uni-stuttgart.de!dns.phoenix-ag.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!skynet.be!skynet.be!newspeer.radix.net!uunet!ash.uu.net!sac.uu.net!lax.uu.net!news.navix.net!u.n.a.c.4.n.c.3.l.l.e.r From: "James Xu" <xu_at_shanghai.samsung.com> Newsgroups: news.admin.censorship,alt.test,comp.databases.oracle.tools Subject: cmsg cancel <a0p5mo$bc1$1_at_mail.cn99.com> Control: cancel <a0p5mo$bc1$1_at_mail.cn99.com> Date: Wed, 2 Jan 2002 03:10:29 GMT Organization: Navix Internet Subscribers Lines: 2 Message-ID: <cancel.a0p5mo$bc1$1_at_mail.cn99.com> NNTP-Posting-Host: 166.102.15.34 X-Trace: iac5.navix.net 1009948065 29203 166.102.15.34 (2 Jan 2002 05:07:45 GMT) X-Complaints-To: abuse_at_navix.net NNTP-Posting-Date: 2 Jan 2002 05:07:45 GMT X-No-Archive: yes Comment: Dude, where's my NewsAgent? Xref: news.uni-stuttgart.de control:40286924

autocancel Received on Mon Dec 31 2001 - 08:53:24 CET

Original text of this message