Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Talendny
Contributor
Contributor

How to add header to the file created with tDBOutputBulkExec component

Hi Team,

I'm using tDBOutputBulkExec component to capture tmap output and to load into DB. But when there is 0 records from tmap, 0kb file is generated which is not allowed in s3, so my job fails in middle way.

Could you please let me know how to add header to this file (file is created at the time of job run). Is there any parameter to be defined?

Labels (3)
4 Replies
Anonymous
Not applicable

Hello,

As the tDBOutputBulk and tDBBulkExec components are used together in a two step process, could you please post your job design screenshots here which will be helpful for us to understand your current situation and address your issue?

Best regards

Sabrina

Talendny
Contributor
Contributor
Author

Hi Xdshi,

 

069U1000000uE3bIAE.png 

I'm connecting tmap to tDBOutputBulkExec component and connecting to RedShift DB. The records passed from tmap is written into a file and file is placed in s3 and then the file writes to db. S3 bucket will not allow 0kb files. Whenever 0 records are passed from tmap, tDBOutputBulkExec generates 0kb file and it is not placed in s3, so jobs throws file not found error when writing to db. If i have an option to write header into file, the file can be placed into s3. I would like to know is there any option or parameters to set file properties to write header while creating the file.

Anonymous
Not applicable

@Yamuna Saravanan​ , the 'Include header' option is not available ontDBOutputBulkExec. As a workaround, write the records into a temporary file using tFileOutputDelmited or memory using tHashOutput, there is a global variable such as ((String)globalMap.get("tFileOutputDelimited_1_FILE_NAME")) that counts the total number of records, check this variable if it greater than 0, then trigger the next processing using runIf connector.

eg.

....tMap--out1--tFileOutputDelimeted_1

--runIf--tFileInputDelimited_1--main--tDBOutputBulkExec_1

 

tFileOutputDelimeted_1: write the records into temporary file.

set the condition of runIf as:

((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE"))>0

tFileInputDelimited_1: read the records back from temporary file.

 

Regards

Shong

 

 

Talendny
Contributor
Contributor
Author

Hi Shong,

 

Than you for your answer