Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Wed, 30 Apr 2008 @ 09:10:35 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Help in a procedure: Counting rows
From:   Parija, Soumya Ranjan

Hi all,

I want to find total number of rows of all tables under a specific user. How can I get similar result.

Example : Output format

     user-tables total_no_of_rows
     ----------- -----------------
     table1 99999
     table2 99999

Any help ll be appriciate. Thanks in advance.

I am writing a proceduer like

Here clips is the user name;

     Replace procedure rowcount( )
     declare ch integer;
     for loopvar as cur1 cursor for
     select distinct tablename from dbc.tables where databasename='clips'
     Set ch:=sel count(*) from clips.loopvar.tablename; // it is having
     insert into rowcount2(loopvar.tablename,ch);
     end for;

How to store rowcount in the variable ch;

I also tried select coun(*) into :ch from clips.loopvar.tablename; IT is also not working.


From the desk of

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020