Hia.
Try taking "--ash.event_id" out.
Last time I tried this, DBI/DBD didnt support comments.
That is handled in the sqlplus interface only.

Hope that helped.
Gordon.


-----Original Message-----
From: Rafael Visser [mailto:[email protected]] 
Sent: 20 January 2009 13:07
To: [email protected]
Subject: ORA-00923

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


Napier University is the best modern university in Scotland* and number one in 
Scotland for graduate employability**
(*Guardian University Guide 2009)
(**HESA 2008)

This message is intended for the addressee(s) only and should not be read, 
copied or disclosed to anyone else outwith the University without the 
permission of the sender.
It is your responsibility to ensure that this message and any attachments are 
scanned for viruses or other defects. Napier University does not accept 
liability for any loss or damage which may result from this email or any 
attachment, or for errors or omissions arising after it was sent. Email is not 
a secure medium. Email entering the University's system is subject to routine 
monitoring and filtering by the University.
Napier University is a registered Scottish charity. Registration number SC018373


Reply via email to