|
|
Archives of the TeradataForum
Message Posted: Fri, 13 May 2005 @ 15:38:13 GMT
Subj: | | Re: Generating the Header and Trailer in the Data File |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, May 13, 2005 09:20 -->
Kumar,
you can easily accomplish the "header" row , however there is no easy solution to add the rowcount, unless you want to reexecute the same query
with a count(*).
** Hope this helps...
.LOGTABLE retail.empdept_fexp;
.LOGON ..........
.BEGIN EXPORT
SESSIONS 20;
.EXPORT OUTFILE C:\myarea\FEXP\retail_empdept
FORMAT TEXT mode record;
Select 'column1-name, column2-name, column3-name, etc.,'
From (select 1 ) as dummy-table ; /** This will get you the header row **/
select
cast(deptno as char(3))
||','||
cast(empno as char(10))
||','||
cast(ename as char(10)) (char(23))
from retail.empdept1
where......
join conditions.....;
/** to add the row count row ***/
Select count(*)
From the-same-table-as-your-above-query
Where the-join-conditions-as-above ;
.END export;
.LOGOFF;
| |