can't get data from multiple databases

2009-05-26 Thread reuvers

Hello,
At the moment i'm using three models, two of them have the same
database and the other one uses a different one.
the center model name is coursedate, a coursedate is linked to a course
(this works) but it's also linked to a user(teacher) but this doesn't
work(from another DB).
here are the model klasses;
 array(
'className'   => 'TblCourse',
'foreignKey'  => false,
'conditions'  => 'TblCourse.crs_id =
TblCourseDate.cda_crs_id'),
'TblUser' => array(
'className'   => 'TblUser',
'foreignKey'  => false,
'conditions'  => 'TblUser.usr_id =
TblCourseDate.cda_usr_id')
);
}
?>

 array(
'className'   => 'TblGroup',
'foreignKey'  => false,
'conditions'  => 'TblCourse.crs_grp_id = TblGroup.grp_id')
);
?>



controller class
set('TblCourseDates', $this->TblCourseDate->find('all'));
$this->set('pagetitle', 'Datums');
}
?>

it generates these queries but the last one doesn't work/is wrong
SELECT TblCourseDate.cda_id, TblCourseDate.cda_date,
TblCourseDate.cda_max_students, TblCourseDate.cda_crs_id,
TblCourseDate.cda_usr_id, TblCourseDate.cda_ext_docent,
TblCourse.crs_id, TblCourse.crs_name, TblCourse.crs_desc,
TblCourse.crs_type, TblCourse.crs_grp_id FROM tbl_course_dates
TblCourseDate LEFT JOIN tbl_courses TblCourse ON (TblCourse.crs_id =
TblCourseDate.cda_crs_id) WHERE TblCourseDate.cda_id = 9
(works)

SELECT TblUser.usr_full_name, TblUser.usr_first_name,
TblUser.usr_user_yn, TblUser.usr_active_start, TblUser.usr_last_name,
TblUser.usr_email, TblUser.usr_active_end, TblUser.usr_id,
TblUser.usr_login FROM tbl_users TblUser WHERE TblUser.usr_id =
TblCourseDate.cda_usr_id
(fails)

anyone knows what i'm doing wrong?
thanks in advance



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



getting data from another oracle database

2009-05-20 Thread reuvers

How would one go about gathering information from an other oracle
database?  My application contains all the relevant information
required except for a few tables i need to read from from another
oracle database
The user i'm using has read rights on that database.

I know it's possible to do this through adding a db configuration and
using this in the model with
var $useDbConfig = 'alternate';

But i want to do this with something like
var $useTable = 'otherDB.tabel';

but is says Missing Database Table.

does anyone know if this is possible

thx in advance!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---