pl/sql accept命令

枫继续吹 2011-11-07 05:24:32

set serveroutput on

accept anum number prompt 'input a number:'

begin
if anum > 100 then
DBMS_OUTPUT.PUT_LINE('bigger');
ELSEIF anum = 100 then
DBMS_OUTPUT.PUT_LINE('same');
else
DBMS_OUTPUT.PUT_LINE('smaller');
end if;
end;
/




SQL> @1
input a number:1
ELSEIF anum = 100 then
*
ERROR at line 4:
ORA-06550: line 4, column 8:
PLS-00103: Encountered the symbol "ANUM" when expecting one of the following:
:= . ( @ % ;
ORA-06550: line 9, column 4:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
if
...全文
180 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
m540920181 2011-11-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 luiseradl 的回复:]
ELSEIF错误,应该是ELSIF
[/Quote]
是的,没看的你写的那个都没有改变颜色吗???
枫继续吹 2011-11-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 luiseradl 的回复:]

ELSEIF错误,应该是ELSIF
[/Quote]

谢谢了,现在对了,还有个错,是因为anum前面没有加&符号,。。。呵呵
我心飞翔 2011-11-07
  • 打赏
  • 举报
回复
ELSEIF错误,应该是ELSIF

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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