Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?
This is what it currently displays
...\Zend\Db\Adapter\Pdo\Abstract.php(220): Zend_Db_Adapter_Abstract->query('UPDATE "diction...', Array)
..and I would like to see the whole update statement before sent to the db to track what is wrong with it.
Thanks for the help. SWK
If you want to view the complete sql statement you can use Zend_Debug. For example if your sql statement is in the variable $select and you want to view the complete sql statement you can use the following line of code:
Or if your code is created withe the Zend_Db_Table class you can use:
I think the best way to view the sql statement is by using the profiling function on the database connection. This is combination withe the logging function and the firePHP add-on for Firefox is my favorite setup.
If you use the MVC configuration of Zend Framework this is done white this lines of code:
The firebug add-on (requirement for firephp) can be found on this website: Firebug
The FirePHP add-on can be found on this website: FirePHP
Ivo Trompert
whilst the profiler is V cool - it doesn't help debug when the system throws an exception..
check out this post on giving a more detailed stack trace inc full SQL
ONLY TO BE USED IN DEV ENVIRONMENTS for obvious reasons
http://www.edmondscommerce.co.uk/blog/zend-framework/zend-framework-more-detailed-stack-trace/