Skip to Content
0
Sep 13, 2005 at 12:55 PM

Executing Native SQL query for oracle

205 Views

Hi,

I want to run following native sql query but it is giving me error ora:933,

DATA: BEGIN OF WA,

TSP_NAME(255) TYPE C,

PER_USAGE(10) TYPE C,

END OF WA.

EXEC SQL PERFORMING loop_output.

select t.tablespace_name,'(' || TO_CHAR(ROUND(100*(NVL(b.bytes,0)/NVL(a

.bytes,0)))) || '%)' "TSUsed%" from dba_tablespaces t,

( select tablespace_name, sum(bytes)/1024/1024 bytes

from dba_data_files group by tablespace_name) a,

( select e.tablespace_name, sum(e.bytes)/1024/1024 bytes

from dba_extents e group by e.tablespace_name ) b,

( select f.tablespace_name, sum(f.bytes)/1024/1024 bytes

from dba_free_space f group by f.tablespace_name ) c

where t.tablespace_name = a.tablespace_name(+) and

t.tablespace_name = b.tablespace_name(+) and

t.tablespace_name = c.tablespace_name(+) into :wa.

ENDEXEC.

Please provide me the soln

Regards,

Bharat Mistry