Closed alex712 closed 7 years ago
Hello guys,
I got the data from oracle in this way in my controller's action:
$connection = ConnectionManager::get('default'); $results = $connection->execute('SELECT * FROM mytable')->fetchAll('assoc'); $query = $connection->newQuery();
Or another way:
$query->select(['field1', 'field2']) ->from('mytable') ->where(['id =' => 1]);
which works fine. But is not same as I am trying with a model:
$this->MyModel->find('all'); This way is giving me an error "ORA-00907: missing right parenthesis ". Can you help me with a suggestion please?
@alex712 I have experienced the same issue, https://github.com/CakeDC/cakephp-oracle-driver/commit/739de49357809e809d8e974d715796b3b6931979 fixes it. But now I got another errors with constraints: Columns used in constraints must be added to the Table schema first.
@spout thanks, that fixed my error. After I modified the file worked fine. Regarding your issue, I'm thinking because you're using constraints on columns. Have you tried to test with a table without constrains?
@alex712 : it's simple constraints like foreign keys, cannot live without this. And I don't know how to bypass this kind of problem.
hotfix merged. issue not reproduced anymore
Hello guys,
I installed cake 3.2 and oracle driver from composer. I configured database connection. All good until I'm trying to bake a Model - I'm getting 2 errors in my console:
Warning: Warning (2): oci_bind_by_name(): ORA-01036: illegal variable name/number in [my_server\vendor\cakedc\cakephp-oracle-driver\src\Database\OCI8\OCI8Statement.php, line 184]
Exception: ORA-00907: missing right parenthesis in [my_server\vendor\cakedc\cakephp-oracle-driver\src\Database\OCI8\OCI8Exception.php, line 26]
My real problem is that I can't create a Model for my table. Can you please help me with any suggestion? Regards