Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table name using lower case #66

Open
gavnyx opened this issue Aug 7, 2020 · 1 comment
Open

Table name using lower case #66

gavnyx opened this issue Aug 7, 2020 · 1 comment

Comments

@gavnyx
Copy link

gavnyx commented Aug 7, 2020

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

@serininformatica
Copy link

i have the same problem with lower case field name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants