The resulting query from the template is created just fine and if I copy/paste it in oracle SQL Developer it executes fine. So no issues there.
However, the query never get executed because I get this error: "Oracle query error: ORA-01036: unrecognized bind variable Student PIDM passed to the bind call Help: ORA-01036 - Database Error Messages"
BTW I'm using node-red-contrib-oracledb-2.
Hi Colin,
Thanks for your reply. As I mentioned in my post the template result is OK. If I copy/paste the result into the database if works.
The issue is not the created result. It seems like something else is expecting me to declare things differently, perhaps.
I've been banging my head for an entire day but cannot find why I get that error.
I concur. I do not think spaces matter because I have another query (update) in the flow and it works fine.
Is only in this insert query that is not happy.
This seems strange as msg.query does not have a variable name like that after it is created with the template node. This would suggest that msg.payload is being parsed as a bind var in the oracle node, try deleting or moving msg.payload prior to the oracle node
Who knew! (I rarely use template node and even rarer do I have spaces in property names!)
As this looks like an Oracle message AND it states your variable by name **"Student PIDM" I suspect it is due to the payload containing these fields BUT you dont use them in the query
Try setting payload to an empty object or null.
PS, although I dont see it documented, i believe there is a way to use bound variables and avoid SQL Injection hacks. At a guess, you would match the values to properties in the payload.
I'm afraid I do not understand your suggestion " try deleting or moving msg.payload prior to the oracle node" because as it stands it is before the oracle node.
Interestingly, though, if I change the message property from msg.query to msg.payload the error it gives me is different:
Please post CODE and TEXT as text (not screenshots) - that way, I can offer you complete code suggestions (I aint gonna re-write what you put in a screenshot!)
Hey Steve,
Changing the name legend from 'Student PIDM' to 'StudentPIDM' may be a bit of a problem because I get the data from the client who in turn uses a piece of software to create the data.
Let me explore if I can do some manipulation of the data on my end to alter the variable names.
Note: Sure, I'll be happy to use formatted code instead of images.
The sample code I wrote above does the remaining of properties to remove spaces.
It only changes the payload going into the oracle node so that the field names match the bindings. Nothing else changes. The database fields stay the same, the supplied data stays the same. the only thing these data values will be used for is passing values to the database.
Oracle query error: ORA-01036: unrecognized bind variable Student PIDM passed to the bind call
I'm beginning to wonder if there is some sort of corruption in the files. I mean, I no longer have a bind variable "Student PIDM" but StudentPIDM.