Home Page for the TeradataForum
 

Archives of the TeradataForum

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


     
  <Prev Next>  
<<First
<Prev
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( )
     begin
     declare ch integer;
     for loopvar as cur1 cursor for
     select distinct tablename from dbc.tables where databasename='clips'
     do
     Set ch:=sel count(*) from clips.loopvar.tablename; // it is having
     problem.
     insert into rowcount2(loopvar.tablename,ch);
     end for;
     end;

How to store rowcount in the variable ch;

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


Regards

From the desk of
Soumya



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