title: codeigniter insert oracle error Filename: C:\xampp\htdocs\system\database\DB_driver.php Line Number: 330
body: <p>So i get this error when i try to insert in an oracle database. I think i have everything configured correctly, and im doing things right, but dont know where the problem is, cause i get no number error.</p>
  
  <p>ERROR:    </p>
  
  <pre><code>Error Number:
  INSERT INTO "articulo" ("id", "titulo", "descripcion", "cuerpo") VALUES (1, 'titulo', 'descripcion', 'CUERPO')
  Filename: C:\xampp\htdocs\system\database\DB_driver.php
  Line Number: 330
  </code></pre>
  
  <p>Controller Class:    </p>
  
  <pre><code>class Articulos extends CI_Controller {
  function index(){
      //cargo el helper de url, con funciones para trabajo con URL del sitio
      $this-&gt;load-&gt;helper('url');
      $this-&gt;load-&gt;database();  
      //cargo el modelo de artículos
      $this-&gt;load-&gt;model('Articulo_model');
  
      //pido los ultimos artículos al modelo
      $this-&gt;Articulo_model-&gt;introducir_articulos();
  }}
  </code></pre>
  
  <p>The function in the model class:    </p>
  
  <pre><code>function introducir_articulos(){
      $data = array(
              'id'=&gt;1,
             'descripcion'=&gt;"descripcion",
             'cuerpo'=&gt;"CUERPO",
             'titulo'=&gt;"titulo"
          );
  
      $this-&gt;db-&gt;insert('articulo', $data); 
  </code></pre>
  
  <p>}</p>
  
  <p>since this has just to insert, it has no views. anyway this is my conf file.</p>
  
  <p>DATABASE.php</p>
  
  <pre><code>$db['default']['hostname'] = 'localhost';
  $db['default']['username'] = 'ci';
  $db['default']['password'] = 'ci';
  $db['default']['database'] = '';
  $db['default']['dbdriver'] = 'oci8';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  </code></pre>
  
  <p>I readed recently, some place dat it's no use to put a database name in the configuration when its based on oracle. </p>
  
  <p>Any help will be welcomed.</p>
  
  <p>ps:sorry about my english.</p>
  
  <p>EDIT:
  Now i know WHY, but not how to fix it, seems like this directly gets this query:</p>
  
  <pre><code>INSERT INTO "articulo" ("id", "titulo", "descripcion", "cuerpo") VALUES (1, 'titulo', 'descripcion', 'CUERPO')
  </code></pre>
  
  <p>it's a quote matter,  it shouldnt be putting quotes to the insert so it should be like this.</p>
  
  <pre><code> INSERT INTO articulo (id, titulo, descripcion, cuerpo) VALUES (1, 'titulo', 'descripcion', 'CUERPO')
  </code></pre>
  
  <p>any tips?</p>
  
  <p>RE-EDIT:</p>
  
  <p>OK this is really insane,wasn't a quote problem, oracle seems to be case sensitive when u write querys from PHP(or at least from code igniter) I just put them in caps lock(as they are in oracle), and worked. so this is the final model's function:     </p>
  
  <pre><code>function introducir_articulos(){
      $data = array(
              'ID'=&gt;5,
              'TITULO'=&gt;"titulo",
             'DESCRIPCION'=&gt;"descripcion",
             'CUERPO'=&gt;"CUERPO"
  
          );
  
  
      $this-&gt;db-&gt;insert("ARTICULO", $data); 
  </code></pre>
  
  <p>}</p>
  
  <p>couldnt answer my own question, so i answered it here.</p>