get full sql error message when using pdo_sql_srv data abstraction driver
get full sql error message when using pdo_sql_srv data abstraction driver
I have been getting sql error messages but they are shortened, for example:
Fatal error: Uncaught PDOException: SQLSTATE[22018]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Conversion failed when converting the varchar value '*' to data type int. in C:\inetpub\wwwroot\goabos\Editor-PHP-1.6.2\php\Database\Driver\Sqlserver\Query.php:112 Stack trace: #0 C:\inetpub\wwwroot\goabos\Editor-PHP-1.6.2\php\Database\Driver\Sqlserver\Query.php(112): PDOStatement->execute() #1 C:\inetpub\wwwroot\goabos\Editor-PHP-1.6.2\php\Database\Query.php(950): DataTables\Database\DriverSqlserverQuery->_exec() #2 C:\inetpub\wwwroot\goabos\Editor-PHP-1.6.2\php\Database\Query.php(292): DataTables\Database\Query->_raw('SELECT ID,\r\n ...') #3 C:\inetpub\wwwroot\goabos\includes\php\getDuplicateBOData.php(47): DataTables\Database\Query->exec('SELECT ID,\r\n ...') #4 {main} thrown in C:\inetpub\wwwroot\goabos\Editor-PHP-1.6.2\php\Database\Driver\Sqlserver\Query.php on line 112
I would love to see the full sql query to see how it is represented by the driver to help with debugging. Also I tried the the new debug flag that works on editor but that does not work in abstraction driver.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Using the Database class directly you can use the
Database->debug()
method to enable logging of the full SQL statement andDataTable->debugInfo()
to then get the full statement. That is what Editor does with the libraries.Allan
Thank you.