1.在oracle中,數據表別名不能加as,如:
select a.appname from appinfo a;-- 正確
select a.appname from appinfo as a;-- 錯誤
也許,是怕和oracle中的存儲過程中的關鍵字as沖突的問題吧
2.在存儲過程中,select某一字段時,后面必須緊跟into,如果select整個記錄,利用游標的話就另當別論了。
select af.keynode into kn from APPFOUNDATION af where af.appid=aid and af.foundationid=fid;-- 有into,正確編譯
select af.keynode from APPFOUNDATION af where af.appid=aid and af.foundationid=fid;-- 沒有into,編譯報錯,提示:Compilation
Error: PLS-00428: an INTO clause is expected in this Select statement
3.在利用select...into...語法時,必須先確保數據庫中有該條記錄,否則會報出"no data found"異常。
可以在該語法之前,先利用select count(*) from 查看數據庫中是否存在該記錄,如果存在,再利用select...into...
文章來源于領測軟件測試網 http://www.kjueaiud.com/