Fast Export
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Fast Export Expand / Collapse
Author
Message
Posted 2/14/2008 11:18:25 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 10/30/2008 8:36:55 AM
Posts: 34, Visits: 48
I have encountered some problems with Fast Export.

Using a training script to train users on Fast Export and Fast Load, we run an export and then run the load.

When we recently ran the export, the file that was output was a flat-file format, where the first column had 11 characters and the second column 6. This basically means that each column in each row is right-justified and padded with enough spaces to bring it up to the column length.

Before, when I ran FastExport it output a tab-delimited file. I could then use this file to demonstrate FastLoad. Now, I would need to open the file up in Excel, and then save it as a tab-delimited, this left-justifies the text and puts the needed tab in.

My question is how can I specify what delimiter FastExport is using?

Here is the script:

.logtable DATABASENAME.NAME_log;


.logon BOX/USERID;




.begin export sessions 4;


.export outfile
x:\export.txt

Mode record format text;

Select prdid (char (11))
,prdcd (char (6))

From DATABASENAME.TABLENAME;


.end export;

.logoff;

As I mentioned, the workaround was to open the output file in Excel, save it as a tab-delimited file and then try the fastload again, and it worked.

I am ok on Fastload, as you can directly set the delimiter you will use, or use the DEFINE to set that up. I just can't understand why FastExport is saving as a flat-file.

Any help would be appreciated!

Thanks!

Andrew Livingston


Andrew C. Livingston
Teradata Certified Professional and Trainer
Post #10590
Posted 2/20/2008 7:47:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/23/2008 10:07:43 AM
Posts: 2, Visits: 8
Andrew,

FastExport will always export a flat (columnar) file in the example you gave as it doesn't have a column delimiter option per se.

What you need to do is add your own delimiter , typically a comma or '|' which you can then import using Fastload or Multiload.
So in your example try something like:

Select
Prdid (char (11))
, ',' (char(01))
, prdcd (char (6))

You then have to import as vartext and specify the said delimiter.

Not pretty but it works.

Another alternative is to get Fastexport to generate a Multiload script which can then be run but maybe that's for another course.
Post #10653
Posted 2/27/2008 9:28:35 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 10/30/2008 8:36:55 AM
Posts: 34, Visits: 48
LooseCannon:

Many thanks for the reply. I thought of this a few days after the post, and will now use this syntax.

It's not pretty, but I suppose one can say that it gives you total control over your export!

Many thank again!

Andrew


Andrew C. Livingston
Teradata Certified Professional and Trainer
Post #10721
Posted 3/12/2008 6:16:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/27/2008 11:37:24 PM
Posts: 5, Visits: 13
If you want to do it in batch, you can:

Select
Trim(Prdid)
||','
||Trim(Prdcd) (Char(40))
From ....
;

That produces a 40 character line with the comma delimited Prdid and Prdcd and spaces at the end. (BTEQ truncates trailing spaces, Fastexport does not.)
We then use a simple sed command to remove the trailing spaces and it is then ready for fastload.
Post #10912
Posted 11/3/2008 8:42:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/3/2008 9:03:40 AM
Posts: 1, Visits: 9
What is simple SED command? Can anyone tell me how to use it?

Thanks and Regards,
Anbarasan Mani
Post #13372
Posted 11/3/2008 7:26:56 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/21/2008 10:45:25 PM
Posts: 79, Visits: 98
Sed is a Unix command. From the Linux Man page:

Sed is a stream editor. A stream editor is used to perform basic text
transformations on an input stream (a file or input from a pipeline).
While in some ways similar to an editor which permits scripted edits
(such as ed), sed works by making only one pass over the input(s), and
is consequently more efficient. But it is sed's ability to filter text
in a pipeline which particularly distinguishes it from other types of
editors.
Post #13374
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 16 ( 16 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:06pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.031. 7 queries. Compression Disabled.