|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/17/2006 1:31:00 AM
Posts: 10,
Visits: 1
|
|
Hi,
Please give inputs to create Flat File in Teradata containing the result set of a query.
Regards Nits
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: 10/12/2006 2:51:00 PM
Posts: 68,
Visits: 1
|
|
Hi Nits, you can create a flat file using fastexport utility.
at this file: .logtable ;
.logon /,
.begin export;
.export outfile mode record format text; /* pay attention, you have to specify both mode record and format text */
select cast( ( cast(field1 as char(xx)) ||cast(field2 as char(xx)) || ) as char(yy)) /* you have to use this final cast where "yy" is the total lenght of the unique field you obtain linking together the fields you are exporting */
from .... where ....
;
.end export; .logoff;
Hope thie helps, Bye, TDUser
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 7/22/2008 3:48:36 AM
Posts: 173,
Visits: 5
|
|
You could replicate the logic of the following example bteq script (which outputs the file as a CSV formatted file):
.SET WIDTH 65531; .LOGON demo/dbc,dbc;
.OS DEL /Q EventLog.txt .EXPORT DATA FILE=EventLog.txt .SET INDICDATA OFF
SELECT Trim(coalesce(cast(DateFld as varchar(32)),'')) ||'|'||Trim(coalesce(TimeFld,'')) ||'|'||Trim(coalesce(UserName,'')) ||'|'||Trim(coalesce(AccountName,'')) ||'|'||Trim(coalesce(Event,'')) ||'|'||Trim(coalesce(LogicalHostId,'')) ||'|'||Trim(coalesce(IFPNo,'')) ||'|'||Trim(coalesce(SessionNo,'')) ||'|'||Trim(coalesce(cast(LogonDate as varchar(32)),'')) ||'|'||Trim(coalesce(LogonTime,'')) ||'|'||Trim(coalesce(LogonSource,'')) FROM DBC.EventLog;
.EXPORT RESET
.LOGOFF .QUIT
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/17/2006 1:31:00 AM
Posts: 10,
Visits: 1
|
|
Please tell me where to get FastExport and BTEQ utilities.
These are freewares or come as part of Teradata.
We are currently using Teradata client version.
Regards Nitin Bajaj
Regards Nits
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: 10/12/2006 2:51:00 PM
Posts: 68,
Visits: 1
|
|
Hi, if you have Teradata RDBMS installed somewhere, on the server you'll find the executable files to run. Usually you find them in Program Files\Ncr\Teradata Client\bin\ directory.
You may execute them directly on the server or using an ETL tool.
Hope this helps, Bye, TDUser
|
|
|
|