hi
i my source table having 5 columns but target i want only empty file(with out columns) by using transformer
empty file
Moderators: chulett, rschirm, roy
You can still map the five fields to the Sequential File stage from the Transformer. In the transformer stage make sure you default all the column derivations to empty strings(''). Make sure you set the First line is Column Names property to True and at the end of the job you will have an empty file. Restricting the row counts out of the transformer stage using system variables is up to you.
P.S. That's a unique requirement.
P.S. That's a unique requirement.
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
-
- Participant
- Posts: 94
- Joined: Fri Dec 14, 2007 3:22 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
You'll have to do something to ensure you get an empty file from a non-empty source. For example, put something in the where clause that ensures you select zero records, where 1 = 2 for example. Or use a contraint in the transformer that ensures no records get past, @FALSE comes to mind.
Last edited by chulett on Sun Aug 15, 2010 7:41 am, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Why? Because I made the silly assumption that (since we're here) the question was not simply how to create an empty file but how to create an empty file using a DataStage job. It's unclear just how "empty" they want it to be, so I was also assuming it should be empty of data but still have the column names in there, otherwise what's the point? Without that all you need is a zero byte file and you can use touch or an equivalent to do that.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers