Matthew Barrett created NIFI-7921:
-------------------------------------

             Summary: 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.12.1, 1.9.1
         Environment: Windows Server 2016
            Reporter: Matthew Barrett
         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.3.4#803005)

Reply via email to