Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi When I do fast export from a

Status
Not open for further replies.

mvnrk

Programmer
Jun 14, 2001
15
US
Hi

When I do fast export from a table(table has 50 columns with integer, varchar, date data types) to flat file, the first column it is creating a junk character. I think it is doing that because of varchar data type. It is creating 2 byte column/record length as a first field in fast export output.
Is there any work around to exclude this first field.(i.e this 2 byte column/Record length).

Thanks in advance.

mvnrk
 
Hi,

Just an example :

DDL :
===
CREATE SET TABLE dev_tampon.logtable ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
(
i INTEGER NOT NULL,
dat DATE FORMAT 'yyyy-mm-dd' NOT NULL,
j INTEGER,
ch VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( i ,dat )

FASTEXPORT SCRIPT:
=================
.logtable log1;
.logon dev9,dev9;

.BEGIN EXPORT;

.EXPORT OUTFILE T1
MODE RECORD FORMAT TEXT;

sel cast ( i as char(2) ),
cast ( dat as char(10)),
cast ( j as char(2) ),
cast ( ch as char(10))
from dev_tampon.logtable;

.END EXPORT;

.LOGOFF;

.QUIT 00;

FASTEXPORT RESULT EXAMPLE:
=========================
892003-01-0188test
4 2003-01-013 test
412003-01-0140test
672003-01-0166test
192003-01-0118test
932003-01-0192test
452003-01-0144test
232003-01-0122test
602003-01-0159test
862003-01-0185test
382003-01-0137test
642003-01-0163test
162003-01-0115test

You can add separate character between the column
if you want

regards

françois
 
Hi GORYN

Thanks for your solution. When you cast columns with char, it pads blank spaces for varchar columns.Thats one problem. If you trim padded space using trim function, it becomes variable length record size, when it becomes variable size record length, Fast export will create record length column as first field in the record.(which looks like Junk characters).So we are back to original problem.

Thanks
mvnrk
 
Are you trying to export comma delimited data?

You can get rid of the 2 byte Varchar length with an OutMod removing those bytes. Check the FastExport manual for an example OutMod.

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top