Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » SQLServerException: Some part of your SQL statement is nested too deeply.
SQLServerException: Some part of your SQL statement is nested too deeply. [message #1001724] Thu, 17 January 2013 04:32 Go to next message
Eclipse UserFriend
Hi,

I use the criteria builder to create a query. The query has a huge amount of parameters. I use this method:

final Predicate[] array;
criteriaBuilder.or(array);

Instead of using OR to concatenate the predicates it creates a nested query.

Shortened example:
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((APPL_INST = ?) OR (APPL_INST = ?)) OR (APPL_INST = ?)) OR (APPL_INST = ?)) OR (APPL_INST = ?)) OR (APPL_INST = ?)) OR (APPL_INST = ?)) OR (APP


In this case I could use IN but not in all cases the APPL_INST is the only parameter.

Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1001883 is a reply to message #1001724] Thu, 17 January 2013 09:09 Go to previous messageGo to next message
Eclipse UserFriend
Perhaps break up your query into multiple queries, or find a more efficient way to query without a huge number of parameters.
Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1001895 is a reply to message #1001883] Thu, 17 January 2013 09:23 Go to previous messageGo to next message
Eclipse UserFriend
I will do that but I'm curious if there is a way to adjust this behavior. The nesting is not necessary for the statement.
Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1004082 is a reply to message #1001895] Tue, 22 January 2013 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Using an IN would avoid all of the ORs.
Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1004096 is a reply to message #1004082] Tue, 22 January 2013 10:12 Go to previous messageGo to next message
Eclipse UserFriend
I get that an IN would work. But it just delays the problem. On Oracle IN is limited to 1000 parameters. It's not that I'm not working on a solution to reduce the high amount of parameters. I just don't understand why the query is nested.
Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1004107 is a reply to message #1004096] Tue, 22 January 2013 10:29 Go to previous messageGo to next message
Eclipse UserFriend
Brackets are used to maintain the order of operations. With all of them OR it is not obvious, but if you mix in AND and other operations, the brackets are required.
Re: SQLServerException: Some part of your SQL statement is nested too deeply. [message #1005754 is a reply to message #1004107] Mon, 28 January 2013 10:01 Go to previous message
Eclipse UserFriend
The code that creates this:
final Predicate[] array;
criteriaBuilder.or(array);


The brackets could be around the ORs because there can't be an AND. There's no nesting required.
Previous Topic:Eclipselink is reverting my LAZY settings
Next Topic:TABLE_PER_TENANT
Goto Forum:
  


Current Time: Wed Jul 23 20:52:51 EDT 2025

Powered by FUDForum. Page generated in 0.35023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top