Closed SSiwek closed 7 months ago
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
Thanks!
This is an automated comment, triggered by adding the label status:need more info
.
The error occurs everytime when I want to sort the attribut dtimemod via the gridview ( Clicking on the header of the table index view )
To reproduce the error you need two tables with same colum names. Than do an inner join. Try to sort after one column via gridview.
As I stated before the sql build tool needs to add the tablename in front of the attribut eg "SHIPCONTPRT.DTIMEMOD" for the order by clause
PDOException: SQLSTATE[HY000]: General error: 918 OCIStmtExecute: ORA-00918: Spalte nicht eindeutig definiert (/builddir/build/BUILD/php-7.2.20/ext/pdo_oci/oci_statement.c:159) in /var/www/html/intranet7/vendor/yiisoft/yii2/db/Command.php:1290 Stack trace:
Next yii\db\Exception: SQLSTATE[HY000]: General error: 918 OCIStmtExecute: ORA-00918: Spalte nicht eindeutig definiert (/builddir/build/BUILD/php-7.2.20/ext/pdo_oci/oci_statement.c:159) The SQL being executed was: WITH USER_SQL AS (SELECT "SHIPCONTPRT". FROM "SHIPCONTPRT" INNER JOIN "SHIP" ON ("SHIPCONTPRT"."ZLAVISNR" = "SHIP"."SHIPID") AND (("SHIP"."SHIPSTAT" < 95) AND ("SHIP"."SHIPTY"='PV')) WHERE ZLLBLNAME is null ORDER BY "DTIMEMOD"), PAGINATION AS (SELECT USER_SQL., rownum as rowNumId FROM USER_SQL) SELECT * FROM PAGINATION WHERE rownum <= 20 in /var/www/html/intranet7/vendor/yiisoft/yii2/db/Schema.php:664 Stack trace:
Additional Information: Array ( [0] => HY000 [1] => 918 [2] => OCIStmtExecute: ORA-00918: Spalte nicht eindeutig definiert (/builddir/build/BUILD/php-7.2.20/ext/pdo_oci/oci_statement.c:159) )
Hi, try specifying the selected columns in your query using the select() method. Had the same issue when the query send to oracle had table.* instead of having the columns one by one
I have an innerjoin on two tables. Both tables do have a column named dtimemod.
In gridview when I click on columnheader to sort, I get ora-00918
I think that the sql build system has to put the tablename in front of every column in the order by clause... It does do so with the rest of the clauses
WITH USER_SQL AS (SELECT "SHIPCONTPRT". FROM "SHIPCONTPRT" INNER JOIN "SHIP" ON ("SHIPCONTPRT"."ZLAVISNR" = "SHIP"."SHIPID") AND (("SHIP"."SHIPSTAT" < 95) AND ("SHIP"."SHIPTY"='PV')) WHERE ZLLBLNAME is null ORDER BY "DTIMEMOD"), PAGINATION AS (SELECT USER_SQL., rownum as rowNumId FROM USER_SQL) SELECT * FROM PAGINATION WHERE rownum <= 20
Additional info