Java Oracle exception - “maximum number of expressions in a list is 1000”

后端 未结 7 729
再見小時候
再見小時候 2020-12-03 05:05

I am passing a list of Strings to my query(SQL query written) to fetch the required data. But I am getting this exception:

ora-01795 maximum number

7条回答
  •  孤街浪徒
    2020-12-03 05:56

    From dba-oracle.com:

    ORA-01795: maximum number of expressions in a list is 1000 tips

    Oracle Error Tips by Burleson Consulting (S. Karam)

    The Oracle docs note this on the ora-01795 error*: ORA-01795 maximum number of expressions in a list is 1000 Cause: More than 254 columns or expressions were specified in a list. Action: Remove some of the expressions from the list. In the Oracle MOSC Forums, an Oracle user was attempting to find a way around error code ORA-01795. His question was answered by Reem Munakash of Oracle:

    The limit in Oracle8 is 1000 expressions. There is a bug 495555, filed against the error text giving the wrong number (254). However, there may be a further restriction depending on the tool you are using. The 1000 expressions is within sqlplus.

    The workaround would be to use a sub-query.

    The bug regarding the error message is fixed in 8.1.5.

提交回复
热议问题