最近又開始 coding ,發現 Oracle 真是古怪,回的錯誤,跟原因有時候不太搭,記錄了下來,就當做是筆記吧...
ORA-06550: line 1, column 7:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <ID>
<外加雙引號的分界 ID> <連結變數> << close current delete
fetch lock insert open rollback savepoint set sql execute
commit forall merge pipe
可能原因為:
sql text 有出現換行,如果為 CommandType.StoredProcedure 建議為單行文字。
ORA-01036: illegal variable name/number
可能原因為:
參數中有 Cursor 時,不能使用 begin <proc> end; 的方式呼叫。
也有可能變數名稱沒有對應正確,
如果使用System.Data.OracleClient 也有可能變數宣告兩次,但是指派一次的錯誤訊息
如果回傳值中,可能有轉型後與原本欄位型態不同的狀況… NVL(sell_price,'N/A') 最好改為 NVL(to_char(sell_price),'N/A')
ORA-24338: statement handle not executed
可能原因為:
OCI-22060: argument [2] is an invalid or uninitialized number
可能原因為:
數值/日期型態並沒有預設值,可以用 NVL() 來避免問題
**2008/11/14 Added**
ORA-01405: fetched column value is NULL
可能原因為:
發生此問題時,是使用 System.Data.OracleClient 取得 DataTable,改用 Oracle.DataAccess.Client 就正常了。
微軟msdn的這篇文章不錯,很有參考價值
http://msdn.microsoft.com/zh-tw/library/haa3afyz(VS.80).aspx
[技術]KB | [技術]未分類