Compare commits

...

3 Commits

Author SHA1 Message Date
jzhao
db9ed5eb0c fix(TPS-3804): add patch note 2020-03-06 11:05:18 +08:00
jzhao
432dc0535a fix(TDI-41651): Add where clause support for update query (#4172) 2020-03-06 09:47:54 +08:00
jzhao
d2c9d8a7ea fix(TDI-41651): Provide possibility to specify alias for output table
ELT(#3645)
2020-03-06 09:47:34 +08:00
4 changed files with 101 additions and 13 deletions

62
PATCH_RELEASE_NOTE.md Normal file
View File

@@ -0,0 +1,62 @@
---
version: 6.4.1
module: https://talend.poolparty.biz/coretaxonomy/42
product:
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-3804
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch\_20200306\_TPS-3804\_v1-6.4.1 |
| Release Date | 2020-03-06 |
| Target Version | 20170623_1246-V6.4.1 |
| Product affected | Talend Studio |
## Introduction
This is a self-contained patch.
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
## Fixed issues
This patch contains this following fix:
- TPS-3804 [6.4.1] tELTJDBC** generating wrong sql (TDI-41651)
## Prerequisites
Consider the following requirements for your system:
- Talend Studio 6.4.1 must be installed.
- This patch is depend on TUP patch **TPS-3715**.
## Installation
### Installing the patch using Software update
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
2) Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
3) On Studio Side: Logon Studio with remote mode, on the logon page the Update button is displayed: click this button to install the patch.
### Installing the patch using Talend Studio
1) Create a folder named "patches" under your studio installer directory and copy the patch .zip file to this folder.
2) Restart your studio: a window pops up, then click OK to install the patch, or restart the commandline and the patch will be installed automatically.
### Installing the patch using Commandline
Execute the following commands:
1. Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
2. initRemote {tac_url} -ul {TAC login username} -up {TAC login password}
3. checkAndUpdate -tu {TAC login username} -tup {TAC login password}
## Uninstallation
Backup the Affected files list below. Uninstall the patch by restore the backup files.

View File

@@ -132,7 +132,15 @@
</PARAMETERS>
<ADVANCED_PARAMETERS>
<ADVANCED_PARAMETERS>
<PARAMETER
NAME="USE_UPDATE_STATEMENT"
FIELD="CHECK"
NUM_ROW="10"
SHOW_IF="DATA_ACTION=='UPDATE'"
>
<DEFAULT>false</DEFAULT>
</PARAMETER>
</ADVANCED_PARAMETERS>
<CODEGENERATION>

View File

@@ -33,6 +33,7 @@ skeleton="../templates/db_output_bulk.skeleton"
String differenttable = ElementParameterParser.getValue(node, "__DIFFERENT_TABLE_NAME__");
boolean useDifferentTable = "true".equals(ElementParameterParser.getValue(node, "__USE_DIFFERENT_TABLE__"));
boolean useUpdateStatement="true".equals(ElementParameterParser.getValue(node, "__USE_UPDATE_STATEMENT__"));
%>
String select_query = null;
String tableName_<%=cid%> = null;
@@ -141,17 +142,32 @@ skeleton="../templates/db_output_bulk.skeleton"
String insertQuery = "INSERT INTO "+tableName_<%=cid%>+"(<%=insertColName.toString()%>) ("+select_query+")";
<%
} else if (("UPDATE").equals(dataAction)){
%>
String updateQuery = "UPDATE "+tableName_<%=cid%>+" SET <%=updateSetStmt.toString()%> "
<%
if(CodeGenerationUtils.hasAlphaNumericCharacter(whereClause)) {
%>
+" WHERE " + <%=CodeGenerationUtils.replaceAllCrBySpace(whereClause)%>
<%
}
%>
;
<%
if(useUpdateStatement){
%>
String updateQuery = select_query;
<%
if(CodeGenerationUtils.hasAlphaNumericCharacter(whereClause)) {
%>
if (updateQuery.toUpperCase().contains(" WHERE ")) {
updateQuery += " AND (" + <%=CodeGenerationUtils.replaceAllCrBySpace(whereClause)%> + ")";
} else {
updateQuery += " WHERE " + <%=CodeGenerationUtils.replaceAllCrBySpace(whereClause)%>;
}
<%
}
} else {
%>
String updateQuery = "UPDATE "+tableName_<%=cid%>+" SET <%=updateSetStmt.toString()%> "
<%
if(CodeGenerationUtils.hasAlphaNumericCharacter(whereClause)) {
%>
+" WHERE " + <%=CodeGenerationUtils.replaceAllCrBySpace(whereClause)%>
<%
}
%>
;
<%
}
} else if (("DELETE").equals(dataAction)){
%>
String deleteQuery = "DELETE FROM "+ tableName_<%=cid%>+" WHERE EXISTS ("+select_query+") "

View File

@@ -39,4 +39,6 @@ TABLE_ACTION.ITEM.CREATE_IF_NOT_EXISTS=Create table if not exists
TABLE_ACTION.ITEM.DROP_IF_EXISTS_AND_CREATE=Drop table if exists and create
TABLE_ACTION.ITEM.DROP_CREATE=Drop and create table
TABLE_ACTION.ITEM.NONE=None
TABLE_ACTION.NAME=Action on table
TABLE_ACTION.NAME=Action on table
USE_UPDATE_STATEMENT.NAME=Use update statement without subqueries