皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
我写的oracle中的一个存储过程,请高手帮忙看看问题出在哪。 题目是这样的: 创建一个存储过程,存储过程名为p_login,用于操作用户登录的校验,登录需要使用EMPNO和EMPPASS,并需要提示登录中的错误,如是EMPNO不存在,还是EMPNO存在EMPPASS错误,还是其他错误等。 要求: 1)不同的输出状态用不同的输出编号标识(out_code)如EMPNO存在且密码正确out_code=0,EMPNO不存在此类错误的out_code=1,用户名存在密码错误out_code=2,其他错误out_code=3 2)不同的输出状态对应不同的输出描述或提示,输出描述用out_desc标识 3)存储过程运行结束要把输出状态对应的输出标识(out_code)和输出描述(out_desc)输出。 以下是我写的脚本: create or replace procedure p_login ( NO IN number, PASS IN nvarchar2, out_code OUT  number, out_desc OUT nvarchar2) is count1 number(10) vcount number(10) other EXCEPTION begin select ID into count1 from EMP where EMPNO= NO select ID into vcount from EMP where EMPPASS= PASS and EMP.ID = count1 if (count1 is not null and vcount is not null) then out_code:=0 out_desc:= '登录成功' elsif (count1 is Null and vcount is Null) then out_code:=1 out_desc:= 'EMPNO不存在' elsif (count1 is not Null and vcount is Null) then out_code:=2 out_desc:= '密码错误' else out_code:=3 out_desc:= '其他错误' end if dbms_output.put_line(out_code||out_desc) end p_login 运行的时候会有错。主要原因是:在oracle中,只要某个参数为空的话 那么系统就报错了。。。这种情况应该怎么处理呢?貌似用IS NULL没用啊?
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【判断题】商业银行到证券市场上市,能在一定程度上解决其不良资产问题。()
A.
正确
B.
错误
【判断题】比例不仅是设计的重要因素,也是服装流行变化的重要因素。
A.
正确
B.
错误
【单选题】There was no_________ about it that they had got the news.
A.
affair
B.
doubt
C.
matter
D.
problem
【单选题】版画的价格大致可以分为两类:一类是消费级,另一类是( )
A.
收藏级
B.
高级
C.
普通级
D.
低级
【简答题】Instead of disturbing Cathy, the news had a strangely calming effect on her mind.
【简答题】简述表空间物理备份和恢复的步骤?
【多选题】月经病的主要病机有
A.
气血失和
B.
脏腑功能失常
C.
冲任损伤
D.
肾一天癸一冲任一胞宫轴失调
E.
带脉失约
【单选题】No sooner _____ they rushed out into the street.
A.
did they hear the news than
B.
had they heard the news than
C.
did they hear the news when
D.
had they heard the news when
【多选题】佛教三宝是指()
A.
B.
C.
D.
E.
【多选题】月经过多的主要病机是冲任不固,经血失于制约,常见的病因有
A.
血热
B.
血寒
C.
血瘀
D.
血虚
E.
气虚
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题