Camel-SQL more than one IN clauses in SQL throws Exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Camel-SQL more than one IN clauses in SQL throws Exception

akpcnu
I am using CAMEL 2.17.3 and having two IN clauses in SQL query causes below exception:

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; Number of parameters mismatch. Expected: 4, was: 8; nested exception is java.sql.SQLException: Number of parameters mismatch. Expected: 4, was: 8

If I have one IN clause query is working fine. Is this known bug or behavior? if yes, any alternative?

ex:

SELECT column1, column2...
FROM <>
WHERE column1 IN (:#in:<<dynamically build>>)
column2 IN (:#in:<<dynamically build>>)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel-SQL more than one IN clauses in SQL throws Exception

Claus Ibsen-2
Try newer Camel version

On Tue, Apr 18, 2017 at 3:47 PM, akpcnu <[hidden email]> wrote:

> I am using CAMEL 2.17.3 and having two IN clauses in SQL query causes below
> exception:
>
> org.springframework.jdbc.UncategorizedSQLException:
> PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state
> [null]; error code [0]; Number of parameters mismatch. Expected: 4, was: 8;
> nested exception is java.sql.SQLException: Number of parameters mismatch.
> Expected: 4, was: 8
>
> If I have one IN clause query is working fine. Is this known bug or
> behavior? if yes, any alternative?
>
> ex:
>
> SELECT column1, column2...
> FROM <
>>
> WHERE column1 IN (:#in:<<dynamically build>>)
> column2 IN (:#in:<<dynamically build>>)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-SQL-more-than-one-IN-clauses-in-SQL-throws-Exception-tp5797818.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel-SQL more than one IN clauses in SQL throws Exception

akpcnu
Thanks Clause, It worked on 2.18.3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel-SQL more than one IN clauses in SQL throws Exception

Claus Ibsen-2
It might also work on the latest 2.17.x release in case you want to
stay on that release branch.

On Tue, Apr 18, 2017 at 5:37 PM, akpcnu <[hidden email]> wrote:
> Thanks Clause, It worked on 2.18.3
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-SQL-more-than-one-IN-clauses-in-SQL-throws-Exception-tp5797818p5797826.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Loading...