FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Tools
Enthusiast

FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Hi,

I am trying to create a sequnce number in the o/p file of the fexp. Can i write a unix shell script to generate a sequence number and use it in the Fexp script. Can please someone give me idea on how to do this. I am new to teradata and am still learning. Any help would be appreciated.

Suji

8 REPLIES
Senior Supporter

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Where do you want the sequence number? In the file name or a sequence number per row?

Enthusiast

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Thanks for the reply ulrich. I want the sequence number in the file that is generated by the fast export which is a fixed length flat file. Actually I am using a wrapper script which generates a text file with the sequence number that is incremented everytime the fastexport script runs. But I am stuck as to how I should use that sequence number in the text file to display it in my final file which is created by the fastexport.

Enthusiast

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

I want the Sequence number in the header record actually...

Senior Supporter

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Which other information do you want to use in your header record?

Can you use TPT? It can write append.

Enthusiast

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

There are some other static and date fiels in my header record....I am new to this TPT...Is there a way to do it with just the Fastexport...?

Enthusiast

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Or can you just give me a sample of TPT write append with the sequence number functionality.....?

Senior Supporter

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

not right away.

things you would need to do:

1. maintain the sequence number within your TD systems and store the current value in a table. Which would contain only one row.

2. export the one row and the date fields etc. which are needed for your header row into the file

3. export the data with write append into the same file

should be possible to do this within a single tpt script.

Check the tpt documentation.

Enthusiast

Re: FASTEXPORT SEQUENCE NUMBER IN OUTPUT FILE

Thanks.