Home » RDBMS Server » Server Administration » Using operator IN
Using operator IN [message #173912] Thu, 25 May 2006 04:16 Go to next message
hanoi
Messages: 2
Registered: May 2006
Location: Rome
Junior Member
Hi! I'm facing a strange problem using IN operator.
Does anybody know which is the maximum number of condition that can be used in Oracle9i?
Does it depends on oracle settings? In this case, how can i increase this number?
Thanks in advance
B
Re: Using operator IN [message #173918 is a reply to message #173912] Thu, 25 May 2006 04:37 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
I seem to remember that the limit is 1000 values, but that could well be wrong.
Jim
Re: Using operator IN [message #173921 is a reply to message #173912] Thu, 25 May 2006 04:42 Go to previous messageGo to next message
yash_v
Messages: 24
Registered: April 2006
Junior Member
I don't remember if there is a documented limit for in operator; but you can either put the in clause value to a temp table and use it or break the in clause values using or

Something like this

Select * from table1 where id in (select id from temp)

Or

Select * from table1 where id in (1,2,3,4,...) or
id in (5,6,7,8,...)

So if you have huge list of values for in operator then use either of these two ways.

Hope this helps you.

Cheers,
Yash

Re: Using operator IN [message #173930 is a reply to message #173912] Thu, 25 May 2006 05:00 Go to previous message
hanoi
Messages: 2
Registered: May 2006
Location: Rome
Junior Member
Thank to both for your kind reply.
I knew that the limit was 1000 for Oracle8i.
Let me give you a bit more detailed information about the strange problem I'm facing.
I have 2 enviroment, using Oracle9i, same version; I alse have a java application that reads and elaborates data retrived from Oracle instance.
Now, it is happening that in one enviroment, everything goes well, without any kind problem; in the second, I got an exception, thrown by Oracle, that seems to be related to a IN condition in one of the queries used by the application.
I'm sure that jdbc driver used are the same, as well as the set of data retrived by application run.
Considering that:
Oracle version is the same; drivers are the same; the set of data to elaborate is the same; java code, as well, is the same, I tought that there might be a parameter set in a different. I looked for details on Oracle documentation, but I couldn't find anything...
Thanks a lot anyway!
Previous Topic: my database does not start automatically
Next Topic: how to unlock a table
Goto Forum:
  


Current Time: Fri Sep 20 11:38:08 CDT 2024