We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Oracle DB - auto-populate ID property upon inserting new record

Hi,

I'm using Phalcon's ORM for interacting with an Oracle DB. I'm trying to set it up so that when I instantiate a new object and store it in the DB then the model object will automatically get it's ID property populated with the auto-generated ID that Oracle assigned for the new record.

I couldn't find any clear documentation about how to acheive this. Facts I managed to collect are:

So, I tried to use all the above info in order to make it happen, but I have a feeling I'm missing something. Don't know what though.

Can anyone post an example of how to make this work?

Thanks! :)



1.3k
edited Jun '15

Hi,

Did you find any solution? I see the same issue with Phalcon 2.0.2 and Oracle 12c. Record is created in db, but ID is empty in Phalcon model after save().