All,
I have to load zero byte file into the table whereas the filename and reason as "File is Empty" needs to be loaded into the table.
My Job design is something below
SeqFile --> Transformer --> TeraData Connector
If the Input file is zero byte none of the record will be uploaded into the database.
Simply O Rows will be processed.
But instead, I want to insert a row into the table with FileName and reason as "File is Empty".
How to change the above design to accommodate this logic ?
Load Zero Byte File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
Load Zero Byte File
Karthik
You could have a file which is the same structure as your input file that has your default message in it.
You could then use the same input stage with multiple file names. Make sure you sort the data ensuring that your default data comes last. You can then filter the line out if the number of input lines is greater than one?
You could then use the same input stage with multiple file names. Make sure you sort the data ensuring that your default data comes last. You can then filter the line out if the number of input lines is greater than one?
Re: Load Zero Byte File
Rather than saying "none of the record will be uploaded" it would be more correct to note that there is no record to be uploaded.karthi_gana wrote:If the Input file is zero byte none of the record will be uploaded into the database.
Another option - check the file size before processing it. When it has data, use your normal job to load it. When it is empty, load it using a job specifically designed for this scenario - take the filename and generate your "File Is Empty" record. More obvious what is going on in that case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers