I would like to load some entities from the repository, but I get this error:
SQLSTATE[22018]: Invalid character value for cast specification: 0 [Microsoft][ODBC Driver 17 for SQL Server]Invalid character value for cast specification (SQLExecute[0] at /builddir/build/BUILD/php-7.3.20/ext/pdo_odbc/odbc_stmt.c:259) in file /srv/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php on line 185
Doctrine tries to execute this query:
SELECT t0.id as id_1, t0.name as name_2 FROM users t0 WHERE t0.is_deleted = ? ORDER BY t0.name ASC
I am able to execute the same query in SQL Server Management Studio, but for some unknown reason, it gives this error in doctrine.
The entity is defined well, because the column and table names are correct, and this query should work. The collation of the database is not unicode, but other tables have no issue with it.
I tried to find a solution, but I was only able to find someone else encountering a similar error when processing a csv file, but it is not relevant for me. My data is already in the database, I just try to read it.