if (!$sth->execute) {
&ERROR("Get => '$query'");
&ERROR("Get => $DBI::errstr");
- &SQLDebug($DBI::errstr);
return;
}
&SQLDebug($query);
if (!$sth->execute) {
&ERROR("GetCol => '$query'");
- &SQLDebug($DBI::errstr);
+ &ERROR("GetCol => $DBI::errstr");
+ return;
}
if (defined $type and $type == 1) {
&SQLDebug($query);
if (!$sth->execute) {
&ERROR("GRI => '$query'");
- &SQLDebug($DBI::errstr);
+ &ERROR("GRI => $DBI::errstr");
}
my @cols;
if (!$sth->execute) {
&ERROR("Raw($prefix): => '$query'");
&ERROR("Raw($prefix): $DBI::errstr");
- &SQLDebug($DBI::errstr);
return 0;
}
sub SQLDebug {
return unless (&IsParam("SQLDebug"));
+ return if (!fileno SQLDEBUG);
+
print SQLDEBUG $_[0]."\n";
}