Oracle Next Id |
[eluser]Druidor[/eluser]
Hello, I'm using CI with Oracle and ActiveRecord. I've got a TODO Table with ID and NAME as fields. I created a sequence and a trigger to fill the ID : Code: CREATE SEQUENCE SEQ_TODO_ID I'm trying to modify the function insert_id of drivers/oci8/oci8_driver.php : here's what I've done : Quote:/** But I got this error : Code: <h4>A PHP Error was encountered</h4> I also tried the SQL query "SELECT SEQ_TODO_ID.CURRVAL FROM DUAL" but I got the same error. Any toughts ?
[eluser]xwero[/eluser]
Have you checked if the oracle driver in SVN has changes?
[eluser]Druidor[/eluser]
Here's the code. It returns 0 all the time. How do I get the id that has been affected to the object ? Code: /**
[eluser]xwero[/eluser]
I guess there is no other way then a select query using max(id) right after you insert a row.
[eluser]Druidor[/eluser]
Actually, this is what I'm doing but I got the same error : Code: function create ($args)
[eluser]xwero[/eluser]
i think you will have to do it in your model and not in the driver because the query is specific for that table. If you got it working in your model maybe you could try to add it to the driver code.
[eluser]Druidor[/eluser]
Here's a print_r of $this->db : Code: CI_DB_oci8_driver Object and the error Code: <p>Message: ocifetchinto() [<a href='function.ocifetchinto'>function.ocifetchinto</a>]: ORA-24374: define
[eluser]Derek Allard[/eluser]
Sorry Druidor, I missed this thread link in my bug response. I've change the behaviour of this function to clearly indicate that it isn't supported. This is something we'd very much like to implement in CI, however I'm unable to find an elegant way to implement this using the oci8 driver. If you can come up with a solution, I'd be very happy to roll it into the core. |
Welcome Guest, Not a member yet? Register Sign In |