laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

ORA-00907: missing right parenthesis

Open mohd-aidi opened this issue 3 years ago • 3 comments

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

mohd-aidi avatar Nov 20 '21 14:11 mohd-aidi

I have the same problem now it caused when I add global scope to order by primary key @yajra when need your help here

Mohammed-Alama avatar Nov 20 '21 16:11 Mohammed-Alama

I think maybe because of order by in the subquery. when i remove that it return fine.

mohd-aidi avatar Nov 21 '21 04:11 mohd-aidi

@mohd-aidi yes that correct but have you tried to solve that in any way

Mohammed-Alama avatar Nov 21 '21 19:11 Mohammed-Alama

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 08 '22 03:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 15 '22 04:10 github-actions[bot]