【发布时间】:2016-06-03 18:18:50
【问题描述】:
我正在尝试将此代码存储在 Oracle 中,并且每次遇到编译错误。我搜索了没有参数的存储过程,但没有找到解决此问题的解决方案。 这是我要存储的过程:
CREATE OR REPLACE PROCEDURE Espacio_libre
BEGIN
select df.tablespace_name "Tablespace",
totalusedspace "MB Usados",
(df.totalspace - tu.totalusedspace) "MB Libres",
df.totalspace "MB Totales",
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace))
"Pct Libre"
from
(select tablespace_name,
round(sum(bytes) / 1048576) TotalSpace
from dba_data_files
group by tablespace_name) df,
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
from dba_segments
group by tablespace_name) tu
where df.tablespace_name = tu.tablespace_name;
END Espacio_libre;
/
谢谢大家。
【问题讨论】:
-
正如“Walid El Oubaha”所说 - 如果没有 INTO 子句,您不能在 PL/SQL 块中使用 SELECT。
标签: sql oracle stored-procedures oracle11g