在执行存储过程中发现了ORA-01403: 未找到任何数据,但是把那段sql打印出来放到命令行运行是有数据的。且该用户具有dba权限,同时也授权了grant select any dictionary to xxx;代码如下:
create or replace procedure test
AUTHID CURRENT_USER as
v_error_col varchar2(1000);
begin
select g.column_name
into v_error_col
from (select r.owner, r.TABLE_NAME, t.COLUMN_NAME
from dba_tables r, dba_tab_columns t
where r.TABLE_NAME = t.TABLE_NAME) g,
dba_col_comments l
where g.table_name = l.table_name
and g.owner=l.owner
and g.column_name = l.column_name
and l.comments =参数
and g.owner =参数
and g.table_name = upper(参数)
group by g.column_name;
dbms_output.put_line(v_error_col);
end;
这个到底是什么原因造成的。
create or replace procedure test
AUTHID CURRENT_USER as
v_error_col varchar2(1000);
begin
select g.column_name
into v_error_col
from (select r.owner, r.TABLE_NAME, t.COLUMN_NAME
from dba_tables r, dba_tab_columns t
where r.TABLE_NAME = t.TABLE_NAME) g,
dba_col_comments l
where g.table_name = l.table_name
and g.owner=l.owner
and g.column_name = l.column_name
and l.comments =参数
and g.owner =参数
and g.table_name = upper(参数)
group by g.column_name;
dbms_output.put_line(v_error_col);
end;
这个到底是什么原因造成的。
解决方案 »
- 请教这种查询如何实现 ?
- 请教关于视图!~
- window2000 profession 能安装oracle9i 企业版吗?
- 请问:如何增加oracle的最大容量限制
- oracle 11i能在windows server 2008上安装吗?
- 还是SQL(希望高手来抢分,不够可加,晚上结贴)
- 求两个Timestamp相减的平均值,怎么写啊?
- select for update of column
- 我建了个数据库,为什么在oracle enterprise manager console中找不到
- 高分求教:先sqlplus /nolog再 connect / as sysdba出现没有足够权限的错误?
- 求助 高手看下
- 数据库dblink
2、一般情况下,为了防止报错,用exception when no_data_found then捕获这个异常
3、从你给的语句上看,返回一个值,过程中没有聚合函数的出现,那group by又是干啥用的呢