We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Accessing Oracle Views using Phalcon

In a Phalcon project, I have multiple database in Oracle and mySQL with number of tables and views. Created models for corresponding tables and views. But unable to access views. I initialize in model below:

public function initialize()

{
    $this->setConnectionService('dbBznes');
    $this->setSchema('POLICY');
    $this->setSource("BUSINESS_ALL"); 
    // view name
}
Return error message : 
Table 'POLICY'.'BUSINESS_ALL' doesn't exist in database

if I use $this->setSource("table1"); is working fine but $this->setSource("view1"); showing error.

I'm not expert on mysql, but is possible describe a view? if its't I think you have to set all metadata manually,

edited Jun '18

I found solution in stackoverflow. Please following the link: https://stackoverflow.com/questions/50712503/phalcon-use-oracle-views

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.