Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
UPDATE TargetTableName
SET ColumnName = (
SELECT StagingColumnName
FROM Stage.StagingTable StagingAlias
LEFT OUTER JOIN Target.TargetTableName TargetAlias
ON TargetAlias.SourceId = StagingAlias.SourceId
WHERE TargetAlias.PrimaryKey IS NOT NULL
AND StagingAlias.SourceTimeStamp > ),
NextColumnName = (
SELECT NextStagingColumnName
FROM Stage.StagingTable StagingAlias
LEFT OUTER JOIN Target.TargetTableName TargetAlias
ON TargetAlias.SourceId = StagingAlias.SourceId
WHERE TargetAlias.PrimaryKey IS NOT NULL
AND StagingAlias.SourceTimeStamp > ),
UPDATE Target.TargetTableName
SET ColumnName = StagingAlias.StagingColumnName,
NextColumnName = StagingAlias.NextStagingColumnName,
...etc
FROM Staging.StagingTableName StagingAlias
LEFT OUTER JOIN Target.TargetTableName TargetAlias
ON TargetAlias.SourceId = StagingAlias.SourceId
WHERE TargetAlias.PrimaryKey IS NOT NULL
AND StagingAlias.SourceTimestamp >
// Line 285 - 304: Two lines weere modified: line 288, the updatesSetStmt and line 303, the updateQuery variable creation
}else{
insertColName.append(colStmt.getName()+suffix);
insertValueStmt.append(colStmt.getValue()+suffix);
updateSetStmt.append(colStmt.getName()+"=\"+routines.system.StringUtils.splitSQLColumns(selectQueryColumnsName)+\"" +suffix);
}
}
counterOuter ++;
}
if(("INSERT").equals(dataAction)){
%>
String insertQuery = "INSERT INTO "+tableName_<%=cid%>+"(<%=insertColName.toString()%>) ("+select_query+")";
pstmt_<%=cid %> = conn_<%=cid%>.prepareStatement(insertQuery);
<%
}else if (("UPDATE").equals(dataAction)){
%>
String updateQuery = "UPDATE "+tableName_<%=cid%>+" SET <%=updateSetStmt.toString()%> " + select_query.substring(select_query.indexOf("FROM"), select_query.length()).trim();
pstmt_<%=cid %> = conn_<%=cid%>.prepareStatement(updateQuery);
Hi,
Can you please explain how you were able to manage to make it work for multiple connections ?
I have a similar scenario where the source and target connections are different.
Thanks,
Prajwala
Hi,
You're right when you say that in ELTMap, Talend only supports one connection, and depending on the size of multiple databases or schemas being used, it could be a problem. One solution might be to generate a fully qualified table name by embedding context variables within an ELT component to qualify a schema. Otherwise, making use of DBInput/DBOutput components or even stored procedures might allow for better control over SQL logic, even if it is not totally ELT-driven.
It could also be a bug in version 6.3.1, so an upgrade or a message to Talend support will help. More insight into ELT processes can be found here, an article on optimizing ELT pipelines; you may find this helpful: ELT Pipeline.