laravelBatch icon indicating copy to clipboard operation
laravelBatch copied to clipboard

operator does not exist: ` character varying when using SQL-Server

Open nexterid opened this issue 4 years ago • 1 comments
trafficstars

when using SQLServer throw this error

[Illuminate\Database\QueryException] "SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near '`'. (SQL: UPDATE ...

so I need to remove backtick symbol from vendor\mavinoo\laravel-batch\src\Batch.php

from

if ($driver == 'pgsql' ) $final[$field][] = 'WHEN ' . $index . ' = '' . $val[$index] . '' THEN ' . $value . ' ';


to

if ($driver == 'pgsql' || $driver == 'sqlsrv') $final[$field][] = 'WHEN ' . $index . ' = '' . $val[$index] . '' THEN ' . $value . ' ';

nexterid avatar Jun 30 '21 03:06 nexterid

hi @nexterid install version v2.2.9

disable backtick for driver pgsql & sqlsrv , commit: d3392a0

mavinoo avatar Jun 30 '21 15:06 mavinoo