Ah yes, I've often wanted also to be able to dump the SQL string but have not seen any such method. I took a look at the source of my copies of DBI.pm and DBD.pm to see if it's an undocumented feature but didn't find any thing like that. Perhaps Tim will add this functionality, a companion method to $sth->dump_results called $sth->dump_query?
-----Original Message----- From: Steven Lembark [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 2:40 PM To: Fong, Anna Subject: RE: Query formatting problem -- "Fong, Anna" <[EMAIL PROTECTED]> > I'm not sure of the source of your assigned variables ($a, $today) and > maybe I don't understand what you're trying to do but wouldn't you want > to make sure the values are valid before even getting to the query? At > that point you can have the script throw an error if the datatype is not > right. Unless you don't know the datatypes in your tables, in which case > you'll need to better coordinate with your DBA. The issue is not validating values, it is reproducing errors in the database shell. Say I run: my $rowz = selectall_arrayref( $sql, undef, @valuz ); and it blows up. The admin's get a message in the file. If my query looked like: select * from foboar where field1 = ? and field2 < ?; then they cannot simply cut+paste the sql in order to reproduce the problem and test why the job failed. This has NOTHING to do with running queries, only reporting errors that show the placeholders interpolated. -- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 888 359 3508
