Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 29 Dec 2008 @ 13:56:07 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: How to Get Count(*) in UNIX Variable
 
From:   Bernard, Vincent

I used this:

I started with the fine UNIX script provided, but made an alteration:

     bteq <my-bteq-out
     .separator '~';
     .logon dbc/dbc,dbcpassword;
     select 'COUNT01', count(*)
        from db.tableone;
     select 'COUNT02', count(*)
        from db.table2;
     .quit;
     ZZ
     # Store in shell variables
     COUNT1=`grep '^COUNT01' my-bteq-out | cut -d"~" -f2` COUNT2=`grep
     '^COUNT02' my-bteq-out | cut -d"~" -f2`
     echo $COUNT1
     echo $COUNT2

Vincent Bernard

Technical Consultant
Teradata V2R5 Certified Master
Microsoft Certified Solution Developer



     
  <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