Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute Query without ->from() #239

Closed
Tigrov opened this issue Sep 27, 2023 · 0 comments
Closed

Execute Query without ->from() #239

Tigrov opened this issue Sep 27, 2023 · 0 comments
Labels

Comments

@Tigrov
Copy link
Member

Tigrov commented Sep 27, 2023

Executing Query without FROM statement fails in Oracle:

$scalar = (new Query($db))->select(new Expression('1'))->scalar();

Tests yiisoft/db#760

https://github.com/yiisoft/db/actions/runs/6324733173/job/17174800505?pr=760

1) Yiisoft\Db\Oracle\Tests\QueryTest::testSelectWithoutFrom
Yiisoft\Db\Exception\IntegrityException: SQLSTATE[HY000]: General error: 923 OCIStmtExecute: ORA-00923: FROM keyword not found where expected
 (/tmp/php-src-php-8.2.10/ext/pdo_oci/oci_statement.c:153)
The SQL being executed was: SELECT 1

This can be solved by adding FROM DUAL for SQL expressions without FROM statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants