Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Documentation of SQL statement.type in Nifi PutDatabaseRecord

avatar
Visitor

Does anyone have experience using SQL value in statement.type for PutDatabaseRecord processor in Nifi?

It is undocumented as to how to format/parameterize this query correctly.  Use of ? or record path values both fail e.g.

INSERT INTO radius.sim_usage(id,sim_id,"ICCID",sim_month,sim_usage,"updatedAt",supplier_id)
VALUES(/id,/sim_id,/iccid,/sim_month,/sim_usage,/updatedAt,/supplier_id)
ON CONFLICT(id)
DO UPDATE SET
sim_usage =
CASE WHEN sim_month <> '${nowDate}'
THEN sim_usage = sim_usage - /sim_usage
ELSE sim_usage = /sim_usage
END

 

INSERT INTO radius.sim_usage(id,sim_id,"ICCID",sim_month,sim_usage,"updatedAt",supplier_id)
VALUES(?,?,?,?,?,?,?)
ON CONFLICT(id)
DO UPDATE SET
sim_usage =
CASE WHEN sim_month <> '${nowDate}'
THEN sim_usage = sim_usage - ?
ELSE sim_usage = ?
END

1 REPLY 1

avatar
Community Manager

@GennyDW Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @MattWho @mburgess  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Senior Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: