|
|
Archives of the TeradataForum
Message Posted: Mon, 29 Dec 2008 @ 13:56:07 GMT
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
| |