You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "DEOM Damien (Jira)" <ji...@apache.org> on 2022/10/05 07:09:00 UTC
[jira] [Commented] (NIFI-7921) ConvertJSONToSQL incorrectly generates UPDATE statement if _ in column name
[ https://issues.apache.org/jira/browse/NIFI-7921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17612867#comment-17612867 ]
DEOM Damien commented on NIFI-7921:
-----------------------------------
You should set Translate Field Names properties to false. That option is quite unreliable
> ConvertJSONToSQL incorrectly generates UPDATE statement if _ in column name
> ---------------------------------------------------------------------------
>
> Key: NIFI-7921
> URL: https://issues.apache.org/jira/browse/NIFI-7921
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.9.1, 1.12.1
> Environment: Windows Server 2016
> Reporter: Matthew Barrett
> Priority: Critical
> Attachments: image-2020-10-14-07-21-09-219.png
>
>
> A database table in SQL Server has a table with structure:
> {code:java}
> CREATE TABLE [Form].[CSI_EXHIBIT](
> [exhibit_Id] [numeric](7, 0) IDENTITY(1,1) NOT NULL,
> [Submission_Id] [numeric](7, 0) NOT NULL,
> [PROPERTY_REF] [varchar](55) NULL,
> [PROPERTY_ID] [varchar](55) NULL,
> CONSTRAINT [P_CSI_EXHIBIT] PRIMARY KEY CLUSTERED (
> [exhibit_Id] ASC)) ON [PRIMARY])
> GO{code}
>
> ConvertJSONToSQL properties:
> !image-2020-10-14-07-21-09-219.png!
> *Database Driver:*
> sqljdbc_8.4 (x64)
> *Java:* 8 (x64)
> *INPUT (Flow Control):*
> {code:java}
> {"PROPERTY_REF":"173021032000000315005011","EXHIBIT_ID":"51"}{code}
> *OUTPUT (SQL):*
> If you have "Translate Field Names" set to false we get: (no column in where)
> {code:java}
> UPDATE Form.CSI_EXHIBIT SET PROPERTY_REF = ? WHERE{code}
> If you have "Translate Field Names" set to true we get: (incorrect column in where should be EXHIBIT_ID)
> {code:java}
> UPDATE Form.CSI_EXHIBIT SET PROPERTY_REF = ? WHERE EXHIBITID = ?{code}
>
> I have tried all upper-case, tried matching case exactly to table
--
This message was sent by Atlassian Jira
(v8.20.10#820010)