Dears, I am trying access system views form Oracle catalog with script below :
#!/usr/local/bin/perl -w $ENV{ORACLE_HOME}="/oracle/8.1.7"; $ENV{NLS_LANG}=" "; $ENV{NLS_DATE_FORMAT}=" "; use DBI; use CGI; my $dbh = DBI->connect( "dbi:Oracle:dbp2","sys","mypass"); my $sth = $dbh->prepare("select sid from v_$session"); $sth->execute; my @row; while (($tablespace)=$sth->fetchrow_array()){ print "$tablespace\n"; } $dbh->disconnect; exit; After run script , i have error message below : Name "main::session" used only once: possible typo at /cdshell/cgi-bin/showsess.cgi line 8. Use of uninitialized value at /cdshell/cgi-bin/showsess.cgi line 8. DBD::Oracle::db prepare failed: ORA-00942: table or view does not exist (DBD: error possibly near <*> indicator at char 17 in 'select sid from <*>v_') at /cdshell/cgi-bin/showsess.cgi line 8. Can't call method "execute" without a package or object reference at /cdshell/cgi-bin/showsess.cgi line 9. I would know how i do to access catalog views with DBI. Regards Alex Marino