I have the most odd problem with a piece of code connecting to an oracle database, it goes like this:
getData{
$sql = shift;
my ($total_cols) = $dbh->selectrow_array($sql) or die($dbh->errstr);
...
doesn't work, gives me
DBD::Oracle::db selectrow_array failed: ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute)
but.. should I take an exact copy of the string $sql (I've even done an ascii comparison on it) and set it inside the subroutine, it works perfectly well, i.e:
getData{
$sql = shift;
$sql = "SELECT COUNT(*) etc blah blah";
my ($total_cols) = $dbh->selectrow_array($sql) or die($dbh->errstr);
...
its driving me mad.. help!