1. 程式人生 > >ORA-21525: attribute number or (collection element at index) string violated its constraints 解決辦法

ORA-21525: attribute number or (collection element at index) string violated its constraints 解決辦法

Exception: 
ORA-21525: attribute number or (collection element at index) string violated its constraints
Cause: Attribute value or collection element value violated its constraint.
Action: Change the value of the attribute or collection element such that it meets its constraints. The constraints are specified as part of the attribute or collection element's schema information.


錯誤原因:
在C#中向儲存過程傳遞資料的時候,使用了oracle的自定義object,但是在傳入的時候,有的obj的欄位,最終傳入的值的長度大於type定義時的長度,就會丟擲這個異常。比如說這次是type number(3) 卻傳入了1100.


可能會有其他的問題,也會丟擲這個異常,不一定跟這次遇到的一模一樣,僅僅是作為一個解決問題的參考。