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

Error Code : 904 -- invalid identifier

Open jaimevendrame opened this issue 8 years ago • 1 comments

I am having problem when using Eloquent: Relationships

     Public function bases ()
     {
         Return $ this-> belongsToMany ('lotecweb \ Models \ Base', 'userbase', 'idusu', 'idbase');
     }

Returns the error:

QueryException in Connection.php line 761: Error Code : 904 Error Message : ORA-00904: "BASE"."ID": invalid identifier Position : 141 Statement : select "BASE"., "USUARIO_BASE"."IDUSU" as "PIVOT_IDUSU", "USUARIO_BASE"."IDBASE" as "PIVOT_IDBASE" from "BASE" inner join "USUARIO_BASE" on "BASE"."ID" = "USUARIO_BASE"."IDBASE" where "USUARIO_BASE"."IDUSU" is null Bindings : [] (SQL: select "BASE"., "USUARIO_BASE"."IDUSU" as "PIVOT_IDUSU", "USUARIO_BASE"."IDBASE" as "PIVOT_IDBASE" from "BASE" inner join "USUARIO_BASE" on "BASE"."ID" = "USUARIO_BASE"."IDBASE" where "USUARIO_BASE"."IDUSU" is null)

Note that: inner join "BASE USER" on "BASE". "ID", but should be: inner join "BASE USER" on "BASE." "IDBASE" Could you help me find a solution?

Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-66-generic x86_64)
"php": ">=5.6.4", "laravel/framework": "5.3.18", "yajra/laravel-pdo-via-oci8": "^1.3.1", "yajra/laravel-oci8": "5.3.*"

jaimevendrame avatar Jun 02 '17 02:06 jaimevendrame

What this ever resolved? I'm having a similar issue with a query involving a pivot table:

select /*+ FIRST_ROWS(150) / "MYTABLE"."ROLES"., "MYTABLE"."ROLE_USER"."USER_ID" as "PIVOT_USER_ID", "MYTABLE"."ROLE_USER"."ROLE_ID" as "PIVOT_ROLE_ID" from "MYTABLE"."ROLES" inner join "MYTABLE"."ROLE_USER" on "MYTABLE"."ROLES"."ID" = "MYTABLE"."ROLE_USER"."ROLE_ID" where "MYTABLE"."ROLE_USER"."USER_ID" = 1 and "MYTABLE"."ROLES"."ID" in (3) order by "ID" desc offset 0 rows fetch next 150 rows only

The 'order by "ID"' is throwing an ambiguously defined column error. This is in Laravel Nova, so I'm not sure if it's a Nova problem or a driver problem but this seems like a very common type of query.

mpspm avatar Nov 17 '18 11:11 mpspm

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

github-actions[bot] avatar Nov 29 '22 02:11 github-actions[bot]

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

github-actions[bot] avatar Dec 07 '22 02:12 github-actions[bot]