Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Creates empty file

Hi,
Talend job creates empty file even after the tDie component triggered.
DBComponent --------->tFileDelimitedOutput
|
onComponentError
|
tDie

DBComponent has a custom query. Sometimes, it can not find a table/column defined in the query. In this case, the job has to abort and should not create an empty file. On the other hand it should create an empty file if the query gives zero records.
The above job handling the second scenario correctly. However, its still creating an empty file, after the query fails because of some error.
Please let me know, if I am missing anything.
Thank you,
Sangi
Labels (2)
4 Replies
Anonymous
Not applicable

Change in the advanced section the option Don'r generate empty file.
The problem is, the file and it handle will be created first and after that your query will be executed.
In this way, the file will be created and if no data set reach the file, the file will be automatically deleted.
_AnonymousUser
Specialist III
Specialist III
Author

Hi,
Thanks for the reply.
I can not use 'Don't create empty file' because we need an empty file when the query in dbcomponent gives zero records.
Regards,
sangi
Anonymous
Not applicable

At first please use OnSubjobError instead of OnComponentError and after OnSubjoberror you can decide to delete your file at first and then call tDie to end the job.
_AnonymousUser
Specialist III
Specialist III
Author

Hi,
Thank you for your time.
I have used the following job and its working fine.
DBComponent --------->tFileDelimitedOutput
|
onComponentError
|
tFileDelete (deleting the same which is created in tFileDelimitedOutput)
|
onComponentOk
|
tDie
Jlolling, if you have time. Can you please let me know whats the exact difference in using onComponentError and onSubjobError in this scenario?
Regards,
Shankar