前段時間寫Oracle存儲過程就遇到問題. 原來寫成這樣 if 1=2 then null; elseif 1=3 then null end if; 在PL/SQL編輯環(huán)境下elseif沒有變色,說明不是關(guān)鍵字。 后來改成 if 1=2 then null; else if 1=3 then null end if; 編譯時報異常。 去goole上百度了下,很多人都說是 elseif。 又試了N邊,編譯總不能通過。 怒了,直接寫成 if 1=2 then null; else if 1=3 then null end if; end if; 問題就解決了。
今天又要在存儲過程中用if...else if ...else if...寫數(shù)據(jù)轉(zhuǎn)換的東東,還按原來那樣寫看著很惡心。 后來發(fā)現(xiàn)是寫成if...elsif...elsif....end if; 神啊,終于被我找到答案了。
返回來看看,原來不是elseif,而是elsif,少了個"e"。他大爺?shù)模陕镆賯€e啊,萬惡的Oracle,真惡心。
不管怎么著,問題總算解決了,TB把這惡心記在心里,以后不犯同樣錯誤。
上網(wǎng)一搜,一群人還在犯錯中……
抄別人邏輯,寫自己代碼,讓他們郁悶去吧!O(∩_∩)O哈哈~
|