Getting Oracle Error in mapping attributes

0
Hello , I am using Oracle Database with database connector but while fetching data from the variables I am getting column not allowed error, I am confirm my syntax is missing which Oracle is not able to accept ,attaching the screen shots for reference. I alse used a string  variable in which I gave the query and passed that variable to the SQL present in Execute statment .  Kindly help me with this ,Thanks pin advence.   Regards, Nasreen shaikh
asked
5 answers
1

i saw NSERT, you should change to INSERT

answered
1

Have a look at using the Execute parameterized query java action. That should escape the values going into the database automatically and prevent you getting the SQL error you are seeing.

There are some more details on this in the documentation. 

https://docs.mendix.com/appstore/connectors/database-connector

answered
0

Are your variables $rollNo, $stuName, and $stuAddress all quoted and escaped correctly if you are injecting them directly into a SQL statement? If not, your SQL could be invalid.

 

answered
0

 

This is the queryu I wrote,

answered
0

Update: like Robert says, you need to prevent your input against SQL injection. So it’s better to use query parameters.

 

You need to use quotes around strings:

'INSERT INTO TABLE (ROLLNO, STUNAME, STUADDRESS) VALUES(' + $rollNo + ', "' + $stuName + '", '" + $stuAddress + '")'


See the difference between numbers and strings:

VALUES(123, "Jerome", "Highstreet 33, Paris")

I guess $rollNo = integer? So you need no extra quotes. Around student name and address you need extra quotes, like above.

answered