You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I have a CakePHP REST API setup with this Oracle driver plugin and it's been working fine for months. That is records are inserted, and retrieved without issue.
However there is one minor issue when performing a POST request (add action). The JSON returned never returns the newly created ID from Oracle. I'm setup on Oracle 11g and have necessary sequence/triggers setup to create new IDs upon insert but all I ever receive is the response below w/ ID = 0:
{ "success": true, "data": { "id": 0 } }
With same code using MySQL the ID is always returned.
I'm using Crud Add action for the REST post request to insert new record.
Just wondering if anyone else has experienced this and if there's a solution (and if it is from oracle side or not).
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Just pushed an update that will automagically set the new id if the sequence is named {tablename}_ID_SEQ.
If the sequence has some other name, then you'll have to manually call the "lastInsertId" function, probably in the table's afterSave function. Something like
Hi
I have a CakePHP REST API setup with this Oracle driver plugin and it's been working fine for months. That is records are inserted, and retrieved without issue.
However there is one minor issue when performing a POST request (add action). The JSON returned never returns the newly created ID from Oracle. I'm setup on Oracle 11g and have necessary sequence/triggers setup to create new IDs upon insert but all I ever receive is the response below w/ ID = 0:
{ "success": true, "data": { "id": 0 } }
With same code using MySQL the ID is always returned.
I'm using Crud Add action for the REST post request to insert new record.
Just wondering if anyone else has experienced this and if there's a solution (and if it is from oracle side or not).
Thanks in advance.
The text was updated successfully, but these errors were encountered: