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

INTONEINTONE Posts: 153Questions: 58Answers: 6

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

Answers

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin
    Answer ✓

    Using the Database class directly you can use the Database->debug() method to enable logging of the full SQL statement and DataTable->debugInfo() to then get the full statement. That is what Editor does with the libraries.

    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6

    Thank you.

This discussion has been closed.