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!

BTEQ Export Command 2

Status
Not open for further replies.

craig322

MIS
Apr 19, 2001
108
US
Does anyone know how to use the BTEQ export command to export data? Everything I try to do pads the data with extra spaces. I have used the FORMAT command with my data elements but that doesn't work.

I have a table that has rows 200+ characters long so I must set my width big enough to accomdate the record.

Thanks

Craig
 
What do you want to do with the data once it is exported?

There are 4 different export modes in BTEQ.

1) REPORT mode which makes all of the characters ASCII and puts spaces between the columns.

2) INDICDATA mode which formats the data for use in a BTEQ IMPORT query.

3) DATA mode which makes the data readable by most programs.

4) DIF mode which is ideal for importing to MS EXCEL.

The format is ".EXPORT {REPORT|INDICDATA|DATA|DIF} FILE=whatever.file"

The issue of the length of records could be handled by the
".SET WIDTH 254" command. 254 is the maximum number of characters BTEQ will output.

Hope this helps.
Tony
 
Does anyone have a fastexport script that will output a delimited file from a teradata table?

Thanks

Craig
 
I don't believe that FastExport allows delimited files, unless you want to concatenate a delimiter between each field. Go back to BTEQ and use the REPORT output format

.Set Separator ':' (this identifies the delimiter this defaults to 2 spaces, so that may be the padding your getting)
.Set Format OFF
.Set Width 200

And in your select statement format each attribute with a null title

Select
FirstName(title ''),
LastName (title '').....





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top