From: James F.H. <jf...@ci...> - 2002-10-22 18:29:33
|
In the process of inserting thousands of records, I occasionally will get an error thrown. Unfortunately, especially in the case of parse errors (such as the ones I got when my backslashed weren't properly escaped), I have no idea what query is causing the problem (I'm parsing a large file and gathering up bits of data at a time, so I can't conveniently go to the offending record). The attached patches add the capability to see the final SQL statment sent to the database server for the DBI module in general and the DBD::Pg driver specifically. e.g: dbh.prepare(UNCANCELLED_LISTING_QUERY) { |sth| sth.execute("jfh", current_month_begin_time) p sth.boundsql } ---------------------------------------------------------------------- | Jim Hranicky, Senior SysAdmin UF/CISE Department | | E314D CSE Building Phone (352) 392-1499 | | jf...@ci... http://www.cise.ufl.edu/~jfh | ---------------------------------------------------------------------- "Given a choice between a complex, difficult-to-understand, disconcerting explanation and a simplistic, comforting one, many prefer simplistic comfort if it's remotely plausible, especially if it involves blaming someone else for their problems." -- Bob Lewis, _Infoworld_ |