Fastexport output

Tools & Utilities
Enthusiast

Fastexport output

I am trying to run the following code

.logtable d_eiadb.temp_log;
.logon tdps/userid,pwd;

.begin export sessions 8;

Select cast(cus_idr as char(10)),
cast(count(*) as char(3))
from d_eiadb.dqrs_base_data
where cus_idr <= 232807215
group by 1;
.export outfile testdate.out;
/* .export outfile testdate.out format fastload mode indicator; */
.end export;

But getting a series of unrecognizable characters. Can anyone help and let me know if I am doing anything wrong?

Raj.
9 REPLIES
Enthusiast

Re: Fastexport output

The default export file format is fastload, which is binary... you may want to try the TEXT format... lookup the fastexport manual for various formats and what they do.
Enthusiast

Re: Fastexport output

Thanks. I tried the text format and it seems to be working but I am getting a blank line in between two rows of data. Any ideas why?
Enthusiast

Re: Fastexport output

Did you specify MODE RECORD in your EXPORT statement ? By default it's INDICATOR MODE and would show up as control characters.
Enthusiast

Re: Fastexport output

Yes, I am not getting the control characters anymore and have added the "mode record" option as well. This is my output...

115600202.1

229615755.1

108907275.1

232403622.1

I would like it to be ....

115600202.1
229615755.1
108907275.1
232403622.1

thanks,
Enthusiast

Re: Fastexport output

can u post ur table DDL, the new fast export script and a sample output of your sql run from queryman...
Enthusiast

Re: Fastexport output

CREATE SET TABLE d_eiadb.dqrs_base_data ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
cus_idr DECIMAL(11,0),
exception_no INTEGER,
exception_val VARCHAR(10) CHARACTER SET LATIN CASESPECIFIC,
date_added DATE FORMAT 'yyyy-mm-dd',
date_resolved DATE FORMAT 'yyyy-mm-dd',
number_of_months INTEGER,
staff_number DECIMAL(8,0))
PRIMARY INDEX ( cus_idr ,exception_no ,date_added );

112501605., 1
112501605., 1
112718384., 1
112706421., 1
198001800., 1
138500741., 1
112713438., 1

.logtable d_eiadb.temp_log;
.logon tdps/balasubramanianr,cricket52;

.begin export sessions 8;

Select substring(cast(cus_idr as char(10)) from 1 for 10)||',',
cast(count(*) as char(3))
from d_eiadb.dqrs_base_data
where cus_idr <= 232807215
group by 1;
.export outfile testdate.out mode record format text;
/* --unformat; */
/* .export outfile testdate.out format fastload mode indicator; */
.end export;

Thanks,
Enthusiast

Re: Fastexport output

Can you try explicitly casting your final column list to CHAR(n) types..

ie like

Select (substring(cast(cus_idr as char(10)) from 1 for 10)||',') (CHAR(11)),
cast(count(*) as char(3))
from d_eiadb.dqrs_base_data
where cus_idr <= 232807215
group by 1;

Enthusiast

Re: Fastexport output

Thanks. I will give it a go.

Re: Fastexport output


Help needed :

I have a set of agent codes for which I want to extract data from teradata table for the specified agents and create new file for each agent codes. The file has to be in excel format. Agent codes are as high as 500 agents.

I could have easily done it in oracle or sql server procedure but here I am finding it difficult. Plz elaborate on how to achieve the same in fast export.