Archives of the TeradataForum
Message Posted: Mon, 02 Apr 2001 @ 21:50:57 GMT
First a request (in two parts) - more out of curiosity than anything else, then a possible answer.
Why do you need to print out a header in the first place? And why couldn't you use the bteq option? In other words, what is the problem that you are trying to solve?
Here is a possible solution. In your fastexport script put two sql statements. The first one select's a bunch of string literals, the second statement select's your actual data. From a previous mail that I replied to that used this technique, I seem to recall that you must always specify a from clause in a fastexport (i.e. it must export from a table) but you don't need to specify any of the columns in the table. So, the SQL in your fastexport might look like this:
Select 'Col_name_1', 'Col_Name_2', 'Col_Name_3' from some_dummy_table_with_one_row_in_it; Select col_1, col_2, col_3 from the_table_you_want_to_export;
With these two SQL statements you will get one row returned from the first select(assuming the dummy table exists and has exectly one row in it) with the columns names. Then the second statement will return the actual data. Fastexport will output all of the results from the first statement before processing the second, so you should get a file with a header record.
I must ask again - why would you want to do this? The first record is pretty much unusable and basically "corrupts" the file.
Hope this helps
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|