请大家帮忙看看这个存储过程有什么问题,报错光标停在select title into v_title那行
===========================================================================
执行时报错为:
ORA-01403: 未找到数据
ORA-06512: 在 "SYSTEM.P_FINDBOOK", line 5
ORA-06512: 在 line 1
===========================================================================
存储过程:
create or replace procedure p_findbook (id in number, title out varchar) AS
v_id number; v_title varchar2(200);begin
select title into v_title
from system.guestbook
where id = v_id;
end p_findbook;
===========================================================================
表字段有id(number), title(varchar2(200))等等
表名字:system.guestbook
===========================================================================
执行时报错为:
ORA-01403: 未找到数据
ORA-06512: 在 "SYSTEM.P_FINDBOOK", line 5
ORA-06512: 在 line 1
===========================================================================
存储过程:
create or replace procedure p_findbook (id in number, title out varchar) AS
v_id number; v_title varchar2(200);begin
select title into v_title
from system.guestbook
where id = v_id;
end p_findbook;
===========================================================================
表字段有id(number), title(varchar2(200))等等
表名字:system.guestbook
解决方案 »
- 请前辈指点下如何生成下面的表
- 一个链接到oracle数据库的固定连接频繁操作数据库遇到的问题!!!!!!!!!!!!!!!!!
- 这个dll触发器有问题吗?
- 用form 10g打开form 6i开发的form文件报错!
- sal=v_sal+200的问题
- 在存储过程中建立表,Oracle8.05不能用excute immediate?怎么办?
- 上百万条记录,四个表+简单的四个条件,请问效率问题该如何解决?
- 帮我优化一下就可以了
- 请教高手,如何在PL/SQL中实现读取随机的n条记录?
- 客户端连接ORACLE数据库 没隔几分钟客户端就掉线了 需要客户端重新登录才能使用。求助
- 计算问题?
- 安装oracle 10g 后无法创建数据库。。。在线等答案
你的传出参数里有title,但是过程里怎么没有相关代码
参数的名称最好避免与表中的字段名重复
id和title最好重新命名
而且where id=v_id这里,v_id还没有赋值呢
begin
select title into v_title
from system.guestbook
where id = v_id;
end p_findbook;
begin
select title into v_title
from system.guestbook
where id = v_id;
exception
when no_data_found then
v_title:=null;
end p_findbook;
自己弄了一个多小时没弄明白。
再次感谢!
执行时报错为:
ORA-01403: 未找到数据
v_id number; v_title varchar2(200); begin
select title into v_title
from system.guestbook
where id = v_id;
--加例处处理
exception
when others then
v_title:=null;
end p_findbook;