laravel-oci8
laravel-oci8 copied to clipboard
ORA-00907: missing right parenthesis
Summary of problem or feature request
When performing eloquent with condition whereHas, it return this error.
Code snippet of problem
Illuminate\Database\QueryException Error Code : 907 Error Message : ORA-00907: missing right parenthesis Position : 118 Statement : select * from "RR_ASSETS" where exists (select * from "RR_BOOKINGS" where "RR_ASSETS"."ID" = "RR_BOOKINGS"."ASSET_ID" order by "BOOKING_DATE" desc) Bindings : [] (SQL: select * from "RR_ASSETS" where exists (select * from "RR_BOOKINGS" where "RR_ASSETS"."ID" = "RR_BOOKINGS"."ASSET_ID" order by "BOOKING_DATE" desc))
$assets = self::whereHas('bookings', function($q){
$q->orderBy('booking_date', 'DESC');
})->get();
System details
- Operating System : Windows Server 2019
- PHP Version : 7.4.3
- Laravel Version : 7.0
- Laravel-OCI8 Version : v7.1.1
- Oracle : 19c
I have the same problem now it caused when I add global scope to order by primary key @yajra when need your help here
I think maybe because of order by in the subquery. when i remove that it return fine.
@mohd-aidi yes that correct but have you tried to solve that in any way
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.