Search code examples
phporacle-databasecodeigniterclob

Insert Oracle CLOB in CodeIgniter


How do we use the CodeIgniter Framework to insert into a table that has a CLOB column?

Table is :

CREATE TABLE NOTIFICATIONS
{
  ID NUMBER,
  CONTENT CLOB
}

The PHP Code is :

$id = 1;
$content = /* An Incredibly Long & Complex String */ 

$query = "INSERT INTO notifications (id,content) values (?,?)";
$this->dbconnxn->query($query, array($id,$content));

But this doesn't seem to work.

Any ideas?


Solution

  • CodeIgniter doesn't support this, you need to do it manually. In order to not re-create a connection to the database, you can use the connection ID created by CI:

    $this->db->conn_id