joeferner / node-persist

Node.js ORM framework supporting MySQL and SQLite 3 relational databases.
253 stars 46 forks source link

Error while saving many to many association in oracle #85

Open harishchander67 opened 11 years ago

harishchander67 commented 11 years ago

While saving associations this SQL is generated for oracle: INSERT INTO amg_user_interest ("amg_user_id","interest_id") VALUES (1234602,1)

It happens due to escaping of values in driver.js (line 45) that generate " in the column names.

Changing this function in oracle.js (changed return '"' + columnName + '"'; to return columnName;

escapeColumnName: function (columnName) { //return '"' + columnName + '"'; return columnName; }

Error: Error starting at line 25 in command: INSERT INTO amg_user_interest ("amg_user_id","interest_id") VALUES (1234602,1) Error at Command Line:25 Column:45 Error report: SQL Error: ORA-00904: "interest_id": invalid identifier

  1. 00000 - "%s: invalid identifier"
zorrofox commented 11 years ago

This issue may just like the #73 and has been resolved. You can update the repo and try again.

harishchander67 commented 11 years ago

That did not help. Version used latest (0.2.7)

zorrofox commented 11 years ago

PLS use the last commit https://github.com/nearinfinity/node-persist/commit/233008d77ec736ffef6055a451f13acc1e7cadf4