andreossido / laravel-odbc

ODBC integration for Laravel framework
35 stars 29 forks source link

SQL compilation error when persisting data from ODBC connection to Laravel application #18

Closed calebeso closed 3 years ago

calebeso commented 3 years ago

Hi there,

I've been using this package to create a connection to my data cloud Snowflake, and it works like a charm! The problem is when I try to persist this data coming from snowflake to my Laravel model. Here's the error:

odbc_prepare(): SQL error: SQL compilation error: Table '"blackboard_ultimo_login"' does not exist or not authorized., SQL state 42S02 in SQLPrepare (SQL: insert into "blackboard_ultimo_login" ("user_id", "name", "email", "funcao", "ultimo_login", "updated_at", "created_at") values (5855, Valdevane, divavvf@gmail.com, S, 2017-06-12 22:30:22, 2021-08-13 16:13:11, 2021-08-13 16:13:11))

Already try to use double quotes and call db name + schema + table name but did not work.

calebeso commented 3 years ago

Figure out!

I have this $protected connection variable setted in my model, so I think ODBC was confused bout wich connection use, since In my method I using DB::connection() to the same database.