Hi. The following sql runs ok by sqlplus on the server.
=================================================================================== SQL> !more wait_class_ii.sql with aux as ( select *--ash.event_id FROM gv$active_session_history ash where ash.sample_time > SYSDATE - 1/1440) select evt.wait_class, count(ash.event_id) FROM aux ash, gv$event_name evt where evt.wait_class in ('User I/O','Network','System I/O','Commit','Other','Application', 'Configuration','Concurrency','Cluster','Administrative') AND ash.event_id(+) = evt.event_id GROUP BY evt.wait_class; SQL> @wait_class_ii.sql WAIT_CLASS COUNT(ASH.EVENT_ID) ---------------------------------------------------------------- ------------------- User I/O 495 Application 0 Network 108 Concurrency 1 Administrative 0 Configuration 0 Cluster 0 Other 169 System I/O 23 Commit 16 10 filas seleccionadas. SQL> =================================================================================== But, when run the same sql on dbi on a client machine, i receive the following error: DBD::Oracle::db prepare failed: ORA-00923: palabra clave FROM no encontrada donde se esperaba (DBD ERROR: error possibly near <*> in dicator at char 134 in 'with aux as (SELECT *--ash.event_id FROM gv$active_session_history ash where ash.sample_time > SYSDATE - 1/ 1440) This is a part of The code $sth=$dbh->prepare("with aux as (SELECT *--ash.event_id FROM gv\$active_session_history ash where ash.sample_time > SYSDATE - 1/1440) SELECT evt.wait_class, count(ash.event_id) FROM aux ash, gv\$event_name evt where evt.wait_class in ('User I/O','Network','System I/O','Commit','Other','Application', 'Configuration','Concurrency','Cluster','Administrative') AND ash.event_id(+) = evt.event_id GROUP BY evt.wait_class ORDER BY count(ash.event_id) DESC "); Do you know where am i doing wrong?.. SUSE Linux version 2.6.16.60-0.31-xen Perl Version = 5.008008 DBI Version = 1.605 Thanks in Advance. rv