CodeIgniter Forums
Wrong query with Database Forge Class and OCI8 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Wrong query with Database Forge Class and OCI8 (/showthread.php?tid=51342)



Wrong query with Database Forge Class and OCI8 - El Forum - 04-30-2012

[eluser]Unknown[/eluser]
Hi to everyone,
I'm trying to execute a simple query with DBForge, my db is Oracle Express 10g.
This is the code:


$this->load->dbforge();

$fields = array(
'id' => array(
'type' => 'INT',
'constraint' => '5',
'unsigned' => TRUE,
'auto_increment' => TRUE
),
'age' => array(
'type' => 'INT',
'constraint' => '3'
)
);

$this->dbforge->add_field($fields);
$this->dbforge->add_key('id', TRUE);

$this->dbforge->create_table('demo_table', TRUE);



When i try to load this controller, i get this error:


A Database Error Occurred

Error Number: 922

ORA-00922: missing or invalid option

CREATE TABLE IF NOT EXISTS "demo_table" ( "id" INT NOT NULL CONSTRAINT 5, "age" INT NOT NULL CONSTRAINT 3, CONSTRAINT demo_table PRIMARY KEY ("id") )

Filename: C:\Program Files (x86)\EasyPHP-5.3.8.0\www\ci_oracle\system\database\DB_driver.php

Line Number: 366

What do you think? Is there any error in my code or is it a bug?