Display contents of table in HTML format

Highlighted
Five Stars

Display contents of table in HTML format

Hi,

 

I have been trying with the below approach but not getting the data in proper email format . Could you please help !!

Design.JPG

 tOracleDBInput:

SELECT
'<tr><td>'||TABLE_NAME.KEY_NUMBER||'</td>'
||'<td>'||TABLE_NAME.TBL_NAME||'</td>'
||'<td>'||TABLE_NAME.SCHEMA_1_COUNT||'</td>'
||'<td>'||TABLE_NAME.SCHEMA_2_COUNT||'</td>'
||'<td>'||TABLE_NAME.COUNT_DIFFERENCE||'</td>'
||'<td>'||TABLE_NAME.UPDATED_TIME||'</td></tr>'
FROM TABLE_NAME;

 

tJavaRow:

context.email = context.email + "<tr><td>" + input_row.KEY_NUMBER + "</td><td>" + input_row.TBL_NAME + "</td><td>" + input_row.SCHEMA_1_COUNT+ "</td><td>" + input_row.SHEMA_2_COUNT + "</td><td>" + input_row.COUNT_DIFFERENCE + "</td><td>" + input_row.UPDATED_TIME+"" + "</td></tr>" ;

 

 

 

tSendmail:

 

"<head><meta http-equiv=Content-Type content=text/html;
charset=iso-8859-15><style type=text/css>table,TD, TH{
white-space: nowrap;
border:1px solid CornflowerGreen ;
font-size:12px;
font-family: Arial;
}
th{
white-space:nowrap;
background-color:CornflowerGreen;
color:Black;
}
<style><head>Hi Team<p><table><th>KEY_NUMBER</th><th>
<TBL_NAME/th><th>SCHEMA_1_COUNT</th><th>SCHEMA_2_COUNT</th><th>COUNT_DIFFERENCE</th><th>UPDATED_TIME</th><tr>"+context.email+"</tr></table>"

 

I am getting only the Headers in the mailbody. Could anyone guide me to get the table data as well.

 

Email:

HTML_Mail.JPG

 Table Format

tABLE_fORMAT.JPG

I will have more than 50 rows in table and the count will vary. What would be the best possible solution to get the data in HTML format thru tSendmail ? 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads