You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Eduardo Fontes <ed...@gmail.com> on 2022/07/20 11:42:50 UTC

Processor PutDatabaseRecord generating invalid SQL

Hi all,

I fired a Jira for this issue in 1.16.3.
[NIFI-10252] Processor PutDatabaseRecord generating invalid SQL - ASF JIRA
(apache.org) <https://issues.apache.org/jira/browse/NIFI-10252>

It is generating UPDATE SQL statement without WHERE keyword.

Thanks. Best regards.
Eduardo Fontes

Re: Processor PutDatabaseRecord generating invalid SQL

Posted by Eduardo Fontes <ed...@gmail.com>.
Patch available:
GitHub Pull Request #6226 <https://github.com/apache/nifi/pull/6226>

On Wed, Jul 20, 2022 at 10:09 AM Eduardo Fontes <ed...@gmail.com>
wrote:

> I think I found the problem.
>
> The code below in PutDatabaseRecord, line 1213, consider that Update Key
> is always in the first position and that's not true.
>
> } else if (i == 0) {
>   // Set the WHERE clause based on the Update Key values
>   sqlBuilder.append(" WHERE ");
> }
>
>
> On Wed, Jul 20, 2022 at 8:42 AM Eduardo Fontes <ed...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I fired a Jira for this issue in 1.16.3.
>> [NIFI-10252] Processor PutDatabaseRecord generating invalid SQL - ASF
>> JIRA (apache.org) <https://issues.apache.org/jira/browse/NIFI-10252>
>>
>> It is generating UPDATE SQL statement without WHERE keyword.
>>
>> Thanks. Best regards.
>> Eduardo Fontes
>>
>

Re: Processor PutDatabaseRecord generating invalid SQL

Posted by Eduardo Fontes <ed...@gmail.com>.
I think I found the problem.

The code below in PutDatabaseRecord, line 1213, consider that Update Key is
always in the first position and that's not true.

} else if (i == 0) {
  // Set the WHERE clause based on the Update Key values
  sqlBuilder.append(" WHERE ");
}


On Wed, Jul 20, 2022 at 8:42 AM Eduardo Fontes <ed...@gmail.com>
wrote:

> Hi all,
>
> I fired a Jira for this issue in 1.16.3.
> [NIFI-10252] Processor PutDatabaseRecord generating invalid SQL - ASF JIRA
> (apache.org) <https://issues.apache.org/jira/browse/NIFI-10252>
>
> It is generating UPDATE SQL statement without WHERE keyword.
>
> Thanks. Best regards.
> Eduardo Fontes
>