菜鸟求助...

tobehungry 2008-12-30 02:27:51
有一个存储过程
procedure term_read_terminfo(caWsId in char,OutPut out char)
as
t1_row terminfo%rowtype;
begin
select * into t1_row from terminfo where termno=caWsId;

OutPut:= NVL(t1_row.termno,' ')||NVL(t1_row.teller_id,' ')||NVL(t1_row.inst_cd,' ')||NVL(t1_row.regn_cd,' ')
||NVL(t1_row.ugrp_cd,' ')||NVL(t1_row.locn_cd,' ')||NVL(t1_row.modl_cd,' ')||NVL(t1_row.verno,' ')
||NVL(t1_row.pinfmt,' ')||NVL(t1_row.term_type,' ')||NVL(t1_row.time_offset,' ')||NVL(t1_row.buss_allow,' ')
||NVL(t1_row.modifydate,' ');

EXCEPTION WHEN NO_DATA_FOUND THEN
OutPut := 'n'; --termno not found
end;

我在sqlplus里面输入
declare
2 a char(16);
3 b char(200);
4 begin
5 a:='015T1';
6 exec term_read_terminfo(a,b);
7 DBMS_OUTPUT.PUT_LINE(b);
8 end;
9 /
结果报错了
ERROR at line 6:
ORA-06550: line 6, column 6:
PLS-00103: Encountered the symbol "TERM_READ_TERMINFO" when expecting one of the following:
:= . ( @ % ;


我找不到原因,求知情人指点我怎么做才能在sqlplus中给存储过程输入参数并且打印出调用结果,另外这个存储过程写的有问题吗?
...全文
61 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wfqqwer5213 2008-12-30
  • 打赏
  • 举报
回复
去掉exec
tobehungry 2008-12-30
  • 打赏
  • 举报
回复
......this procedure is writed by other people,I can use it,but can't change it.
xkx2003 2008-12-30
  • 打赏
  • 举报
回复
带返回值的,楼主可以使用函数

把过程改成函数
然后在sqlplus里面直接
exec term_read_terminfo('015T1');

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧