• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error with Join and Active Record

#1
[eluser]Unknown[/eluser]
Hello

I’m trying to follow documentation for creating a join (http://ellislab.com/codeigniter/user-gui...ecord.html)

The doc says :
Code:
$this->db->select('*');
$this->db->from('blogs');
$this->db->join('comments', 'comments.id = blogs.id');
$query = $this->db->get();
so I have tried :
Code:
$this->db->select('marker_id, marker_name, taxon.scientific_name, marker.group_id', FALSE);
$this->db->from("marker");
$this->db->join('taxon', 'taxon.taxon_id = marker.taxon_id','inner');
but I’m facing an error (even using the FALSE param in select method) :

Quote:Error Number:

SELECT marker_id, marker_name, taxon.scientific_name, marker.group_id FROM "marker" INNER JOIN "taxon" ON "taxon"."taxon_id" = "marker"."taxon_id"

ORA-00942: table or view does not exist

You can see this post : http://ellislab.com/forums/viewthread/207389/

Even with a really simple query :

Code:
$this->db->select('marker_id, marker_name, group_id', FALSE);
$this->db->from('marker');
Quote:Error Number:

SELECT marker_id, marker_name, group_id FROM "marker"

ORA-00942: table or view does not exist

I need help or some explanations. The escape rules for lazy seem to prevent me to build a correct query !

I should miss something, and I need your help

Thank you.

(Oracle database 11.2.0.1.0, CI 2.1.0)

Fred

#2
[eluser]Unknown[/eluser]
Hello

Code:
$this->db->select('marker_id, marker_name, taxon.scientific_name, marker.group_id', FALSE);
$this->db->from('marker, taxon');
$this->db->where('taxon.taxon_id = marker.taxon_id','inner');

it does not work :
Quote:Error Number:

SELECT marker_id, marker_name, taxon.scientific_name, marker.group_id FROM "marker", "taxon" WHERE "taxon"."taxon_id" = marker.taxon_id 'inner'

Look at the where clause :
taxon and taxon_id are enclosed by ", marker is not !

Does somebody else use CodeIgniter with an Oracle database ?

Fred


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.