Welcome Guest, Not a member yet? Register   Sign In
[solved] Alternative for $this->db->insert_id() on Oracle
#2

[eluser]fszostak[/eluser]
Hi All!

I solved this issue and AUTOINCREMENT field together.

Code:
private function insert() {
  $this->ID = $this->getNextId();
  $this->db->insert($this->getTableName(), $this);
  $this->log($this->ID);
}
private function getNextId() {
  $this->db->select($this->getTableName()."_SEQUENCE.NEXTVAL AS NEXTID", FALSE);
  $this->db->from("dual");
  $query = $this->db->get();
  $row = $query->row();
  return $row->NEXTID;
}


Messages In This Thread
[solved] Alternative for $this->db->insert_id() on Oracle - by El Forum - 08-05-2010, 10:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB