I have little experience with DB2. I have been trying to find out how to get the number of affected rows (after insert and merge statements) and/or a success message to give back to my HTTP Post request. Can anyone help me on this?

Using DB2 node in Node-RED.

  • That certainly depends on what client interface you use to run your statements. – mustaccio Feb 14 '18 at 18:16
  • I am using Node-RED with DB2 nodes. – rtrigo Feb 15 '18 at 9:13
  • 1
    I'm not familiar enough with Node+DB2, but if you can wrap the INSERT in a SELECT you can use "data-change-table-references" to SELECT COUNT(*) FROM NEW TABLE(INSERT INTO some-table ...) – Dave Jones Feb 15 '18 at 11:04
  • 1
    @DaveJones: Please consider reposting your comment as an answer, as it seems to have helped the OP, thanks. – Andriy M Feb 16 '18 at 12:41
  • Is it possible to do something equivalent with a MERGE statement? – rtrigo Feb 19 '18 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.