Google Analytics İzleme

21 Ağustos 2009

ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir

Aşağıdaki hatayı alıyorsanız:
ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir
ORA-01795 Maximum number of expressions in a list is 1000.

Şu adımları uygulayabilirsiniz:
---------------------------------

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.

----------------------------------

the problem is purely related to oracle limitations.

One possible workaround would be to split the IN clause in several parts with less than 1000 elements
and concatenate the new IN clauses with OR:

like : SELECT * FROM TableX where (TableX.column IN (?, ..., '<=1000 ?' ) OR TableX.column IN (?, ..., '<=1000 ?' ) OR ...)


------------------------------------

There is a miximum number of elements allowed in an IN list and it is 1000. Go beyond this and you get this error. I suspect toad has generated a query that exceeds this limit.

The two most common approaches to getting around this are:

1) split the workload up such that you never generate more than 1000 items in an IN list (this was suggested already)

2) join to a table that contain the list of values you want. There is no limit with this method as it is a simple join.

Good luck, Kevin

------------------------------------------

-- Instead of having:
s.userId IN (:users)
-- We will have:
(
s.userId IN (:users0) OR
s.userId IN (:users1) OR
... OR
s.userId IN (:usersN)
)

-------------------------

Kaynak:
http://codingwithcoffee.com/?p=121
http://jira.springframework.org/browse/SPR-3396
http://ordba.blogspot.com/

Hiç yorum yok: