0
I have a database in Sybase (Adaptive Server Enterprise) and we started using the Laravel framework to transfer existing systems to it (a migration in BD cannot be contemplated).
Laravel by default cannot connect to the ODBC protocol, let alone Sybase. It is possible, through Freetds, to use Dblib from Sqlserver for this task, but it works only on Linux and I need this to be possible on both Windows and Linux.
Knowing that Laravel uses the PDO function, I implemented, from the Sqlserver codes, classes to be possible to connect to Sybase (from the ODBC protocol and the Adaptive Server Enterprise driver).
I can do absolutely everything with Sybase from PDO with pure php, but in Laravel, only SELECT works, giving the same error at least in UPDATE and INSERT. I am using the same settings in both cases, and it gives the following errors:
Error 1/2:
PDOException in Connection.php line 358: SQLSTATE[ZZZZZ]: <<Unknown error>>: 3811 [Sybase][ODBC Driver][Adaptive Server Enterprise]Um datastream incorreto foi enviado ao servidor. O servidor esperava o token 1 porém recebeu o token 0. Isto é um erro interno. (SQLExecute[3811] at ext\pdo_odbc\odbc_stmt.c:254)
Error 2/2
QueryException in Connection.php line 621: SQLSTATE[ZZZZZ]: <<Unknown error>>: 3811 [Sybase][ODBC Driver][Adaptive Server Enterprise]Um datastream incorreto foi enviado ao servidor. O servidor esperava o token 1 porém recebeu o token 0. Isto é um erro interno. (SQLExecute[3811] at ext\pdo_odbc\odbc_stmt.c:254) (SQL: insert into [produtos] ([nome], [descr]) values (teste, teste))
The detail is that in Linux with Dblib, works with the same settings for Grammar and Postprocessor.
Probably Sysbase does not accept Prepared statments.
– gmsantos
It has more to do with ODBC on PDO, because Dblib on Linux works without any choking, or maybe it’s another dark mystery about Sybase.
– Gabriel Tadra Mainginski