首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

打印表名的存储过程,不知道错在哪里?解决思路

2012-02-09 
打印表名的存储过程,不知道错在哪里?存储过程:SQL codecreate or replace procedure query_tables ascurso

打印表名的存储过程,不知道错在哪里?
存储过程:

SQL code
create or replace procedure query_tables ascursor c_row_recisselect table_name from user_tables where table_name like 'LEE_CLIENT%';begin for v_row_rec in c_row_rec loop  dbms_output.put_line(v_row_rec.table_name);  end loop;end;


执行 exce query_tables后 提示:
cann't perform this operation on a close dataset

请教达人!

[解决办法]
exce query_tables?
写错了
[解决办法]
我用你的存储过程在我本机试了一下没有任何错误
begin
-- Call the procedure
query_tables;
end;
[解决办法]
写的应该没有错误。

可以执行。

引用楼主 zhuche110 的帖子:
存储过程:

SQL codecreate or replace procedure query_tables as
cursor c_row_rec
is
select table_name from user_tables where table_name like 'LEE_CLIENT%';
begin
for v_row_rec in c_row_rec loop
dbms_output.put_line(v_row_rec.table_name);
end loop;
end;




执行 exce query_tables后 提示:
cann't perform this operation on a close dataset

请教达人!

[解决办法]
在数据库端写的right,执行没有错误。
你的报错信息不像oracle的报错,应该是应用调用query_tables时报的错吧,可能是应用调用的代码写的有问题。

探讨
写的应该没有错误。

可以执行。

引用楼主 zhuche110 的帖子:
存储过程:

SQL codecreate or replace procedure query_tables as
cursor c_row_rec
is
select table_name from user_tables where table_name like 'LEE_CLIENT%';
begin
for v_row_rec in c_row_rec loop
dbms_output.put_line(v_row_rec.table_name);
end loop;
end;


执行 exce query_tables后 提示:
cann't perform thi…

[解决办法]
toad的DBMS OUTPUT 
ENABLED了吗?
默认是disabled的啊,你要按下红灯,变成绿灯才行啊
[解决办法]
toad的DBMS OUTPUT 需要亮绿灯才能看到输出。我在自己的数据库上执行了一下,是可以的,但可以匹配上的表太多的话,需要等1、2秒才能看到输出结果。
[解决办法]
set serveroutput on与你的存储过程无关

热点排行
Bad Request.