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

Phalcon and Oracle poor integration?

Phalcon 2.0.3 and Oracle 12c

How can I use Oracle reserved words in Phalcon queries?

$conditions = "bannerType = :bannerType: and startTime > sysdate"; $parameters = array('bannerType'=>$bannerType); $banners = Banner::find(array($conditions,"bind" => $parameters));

It gives me the error:

Column 'sysdate' doesn't belong to any of the selected models (1), when preparing: SELECT [Vokuro\Models\Banner].* FROM [Vokuro\Models\Banner] WHERE bannerType = :bannerType: and startTime > sysdate and bannerStatus = :bannerStatus:

0 [internal function]: Phalcon\Mvc\Model\Query->_getQualified(Array)

1 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

2 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

3 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

4 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array)

5 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()

6 [internal function]: Phalcon\Mvc\Model\Query->parse()

7 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL)

8 /home/var/www/html/v1/app/controllers/BannerController.php(92): Phalcon\Mvc\Model::find(Array)

9 [internal function]: Vokuro\Controllers\BannerController->getAllAction()

10 [internal function]: Phalcon\Dispatcher->dispatch()

11 /home/var/www/html/v1/public/index.php(44): Phalcon\Mvc\Application->handle()

12 {main}

I would recommend to install phalcon 2.0.8. Are some ORM fixes along the way, including for Oracle. I'm not sure if it solves this, but you can give it a try.



85.5k

in mysql is [columnName], can you give it a try ?



1.3k

Hi, 2.0.8 i didn't try yet.

As for [sysdate] - the same error.

    $conditions = "bannerType = :bannerType: and startTime>[sysdate]";
    $parameters = array('bannerType'=>$bannerType);

Column 'sysdate' doesn't belong to any of the selected models (1), when preparing: SELECT [Vokuro\Models\Banner].* FROM [Vokuro\Models\Banner] WHERE bannerType = :bannerType: and startTime>[sysdate] and bannerStatus = :bannerStatus:

0 [internal function]: Phalcon\Mvc\Model\Query->_getQualified(Array)

1 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

2 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

3 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array, true)

4 [internal function]: Phalcon\Mvc\Model\Query->_getExpression(Array)

5 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()

6 [internal function]: Phalcon\Mvc\Model\Query->parse()

7 [internal function]: Phalcon\Mvc\Model\Query->execute(Array, NULL)

8 /home/var/www/html/v1/app/controllers/BannerController.php(97): Phalcon\Mvc\Model::find(Array)

9 [internal function]: Vokuro\Controllers\BannerController->getAllAction()

10 [internal function]: Phalcon\Dispatcher->dispatch()

11 /home/var/www/html/v1/public/index.php(44): Phalcon\Mvc\Application->handle()

12 {main}

Oracle DB support is really needed for enterprise projects, so the Phalcon could establish its position in the big projects!