Insert using node-red-contrib-oracledb-mod

I'm working on a Node-RED flow to insert random data into an Oracle database table at regular intervals, but I'm facing an issue where all the inserted values end up being NULL. I need help identifying where I might be going wrong.

This is the flow:

In Function Node:

In SQL query of Oracle Node:

Lastly in Field Mapping of Oracle Node:

After injecting to run the insert query, the debug message:

I'm using this node, doing many inserts. I don't know how to solve your issue, but I just specify the whole SQL block in msg.query, and it works perfectly.

1 Like

msg.query in Function node? did you write anything into Field Mappings?

At a random guess, should/could the payload be an array instead of hash? I've not worked with the Oracle node so I'm only guessing but since the field mappings screenshot states "always use field mappings (even if msg.payload is an array)" - so payload can also be an array.

Second question: is the syntax :column1 (i.e. colon followed by column name) the correct syntax in the SQL query tab?

1 Like

I leave it empty. You can use msg.mapping.

1 Like