You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a trouble while using query builder because my table name in db2 using lower case. How to fix this?
I try double quote but not fixed it.
Error message without quote ($users = DB::table('users')->get();):
Illuminate\Database\QueryException
SQLSTATE[42S02]: Base table or view not found: -204 [IBM][CLI Driver][DB2/LINUXX8664] SQL0204N "APP_PUTUSAN.USERS" is an undefined name. SQLSTATE=42704 (SQLNumResultCols[-204] at /tmp/PDO_IBM-1.3.6/ibm_driver.c:153) (SQL: select * from users)
Error message when using double quote ($users = DB::table('"users"')->get();):
Illuminate\Database\QueryException
SQLSTATE[42601]: Syntax error: -104 [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token """" was found following "select * from ". Expected tokens may include: "". SQLSTATE=42601 (SQLNumResultCols[-104] at /tmp/PDO_IBM-1.3.6/ibm_driver.c:153) (SQL: select * from ""users"")
Note:
I can get that data using raw query like this:
$users = DB::select('select * from "users"'); // I'm using double quote on table name
The text was updated successfully, but these errors were encountered:
I have a trouble while using query builder because my table name in db2 using lower case. How to fix this?
I try double quote but not fixed it.
Error message without quote ($users = DB::table('users')->get();):
Illuminate\Database\QueryException
SQLSTATE[42S02]: Base table or view not found: -204 [IBM][CLI Driver][DB2/LINUXX8664] SQL0204N "APP_PUTUSAN.USERS" is an undefined name. SQLSTATE=42704 (SQLNumResultCols[-204] at /tmp/PDO_IBM-1.3.6/ibm_driver.c:153) (SQL: select * from users)
Error message when using double quote ($users = DB::table('"users"')->get();):
Illuminate\Database\QueryException
SQLSTATE[42601]: Syntax error: -104 [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token """" was found following "select * from ". Expected tokens may include: "". SQLSTATE=42601 (SQLNumResultCols[-104] at /tmp/PDO_IBM-1.3.6/ibm_driver.c:153) (SQL: select * from ""users"")
Note:
I can get that data using raw query like this:
$users = DB::select('select * from "users"'); // I'm using double quote on table name
The text was updated successfully, but these errors were encountered: