DBD-Oracle - Problem when prepare request (wildcard added)

Posted on Tue Oct 23 09:24:11 2007 by smutel
Problem when prepare request (wildcard added)
Hello,

I have a problem with DBD-oracle but I don't know if it is a DBD-oracle problem or a problem with my oracle client configuration.

I use :
- Fedora Core 7
- Oracle Client 10.2.0.3-1
- DBD-Oracle-1.19
- Perl 5.8.8

export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client
export TNS_ADMIN=$ORACLE_HOME

sqlnet.ora :
NAMES.DIRECTORY_PATH= (TNSNAMES)

In my script (in fact check_ora_table_space.pl nagios script) :

my $dbh = DBI->connect( "dbi:Oracle:host=$host;port=$port;sid=$sid", $dbuser, $dbpass, { PrintError + => 0, AutoCommit => 1, RaiseError => 0 } ) || &error ("cannot connect to $dbname: $DBI::errstr\n"); $sth = $dbh->prepare(q{SELECT tablespace_name, SUM(BYTES)/1024/1024 FreeSpace FROM dba_free_space g +roup by tablespace_name}) || &error("Cannot prepare request : $DBI::errstr\n"); $sth->execute || &error("Cannot execute request : $DBI::errstr\n");


Result :

Cannot prepare request : ORA-00942: table or view does not exist (DBD ERROR: error possibly near <* +> indicator at char 60 in 'SELECT tablespace_name, SUM(BYTES)/1024/1024 FreeSpace FROM <*>dba_free +_space group by tablespace_name')


I don't know why <*> is added to the request ?

Thanks for your help.
Direct Responses: 6404 | Write a response