getting data from another oracle database
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 -~--~~~~--~~--~--~---
Re: getting data from another oracle database
With cake ORM you can refer different databases by DB configs but not by table names as cake always properly escape it for sure. Why don't you like $useDbConfig way? On May 20, 6:25 pm, reuvers reuv...@gmail.com wrote: 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 -~--~~~~--~~--~--~---
Re: getting data from another oracle database
reuvers, Here is how I did it and it was for Oracle and this type of functionality is ,imho, an edge case, so I had to hack up the dbo_oracle file. I have an application DB and dozens of target DBs(other physical servers). I have a table in the application DB that holds connection info to all the other target DBs. I dynamically load database settings using ConnectionManager and set the current one by overriding the __construct method within each model that resides on a different DB. Some caveats, you won't be able to join tables across the DBs. The way that errors are returned in cake, it only handles the last error for a single connection. Since I have to connect to dozens of DBs, I had to modify the error handling to basically return an array of connection handles = errors. But if you know in advance all of the DBs you need to connect to, you can define them in your database.php file and just override within the model file, which connection to use. humbao reuvers wrote: 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 -~--~~~~--~~--~--~---
Re: getting data from another oracle database
But if you know in advance all of the DBs you need to connect to, you can define them in your database.php file and just override within the model file, which connection to use. It is not nessecary. DB config can be created on the fly and model can be switched to it also in runtime. Search this group for complete solutions. On May 21, 12:32 am, humbao hum...@gmail.com wrote: reuvers, Here is how I did it and it was for Oracle and this type of functionality is ,imho, an edge case, so I had to hack up the dbo_oracle file. I have an application DB and dozens of target DBs(other physical servers). I have a table in the application DB that holds connection info to all the other target DBs. I dynamically load database settings using ConnectionManager and set the current one by overriding the __construct method within each model that resides on a different DB. Some caveats, you won't be able to join tables across the DBs. The way that errors are returned in cake, it only handles the last error for a single connection. Since I have to connect to dozens of DBs, I had to modify the error handling to basically return an array of connection handles = errors. But if you know in advance all of the DBs you need to connect to, you can define them in your database.php file and just override within the model file, which connection to use. humbao reuvers wrote: 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 -~--~~~~--~~--~--~---