有個開發(fā)人員遇到錯誤:ORA-01795: 列表中的最大表達式數(shù)為1000語句為一個select xxx from xxx where xxx in (xx,xx,.....);下面
有個開發(fā)人員遇到錯誤:ORA-01795: 列表中的最大表達式數(shù)為1000
語句為一個select xxx from xxx where xxx in (xx,xx,.....);
下面我們來看一下這是什么錯誤:
01795, 00000, "maximum number of expressions in a list is 1000"
// *Cause: Number of expressions in the query exceeded than 1000.
// Note that unused column/expressions are also counted
// Maximum number of expressions that are allowed are 1000.
// *Action: Reduce the number of expressions in the list and resubmit.
從這里可以看出,是一個list里面最多1000個值,也就是說in里面最多1000個值,如果in的括號里面超過了1000個值,就會報這個錯誤。
解決的方法和簡單,就是把一個in拆分成多個in,如果超過了1000就拆分成2個in,,如果超過了4000,就拆分成5個in
改成sql如下:select xxx from xxx where xxx in (xx,xxx...) or xxx in (xx,xx,...) or xxx in (xx,xx,...);
相關閱讀:
GoldenGate不使用數(shù)據(jù)泵完成Oracle-Oracle的雙向復制
使用GoldenGate的數(shù)據(jù)泵進行Oracle-Oracle的單向復制
如何對 Oracle 數(shù)據(jù)泵(expdp/impdp) 進行 debug
Oracle 數(shù)據(jù)庫導出數(shù)據(jù)泵(EXPDP)文件存放的位置
Oracle 10g 數(shù)據(jù)泵分區(qū)表的導出
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com