You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Karts <ka...@gmail.com> on 2016/07/20 15:47:57 UTC

RE: camel sql joined query with parameters won't run on sql server

I have the same issue with sql server, but it seems to be related to alias +
named param rather than a joined query.

The following works fine:

.setHeader("ExternalRef", simple("1234"))
.to("sql:select event from events where id= :#ExternalRef")

But if I alias the table :

.setHeader("ExternalRef", simple("1234"))
.to("sql:select t.event from events t where t.id= :#ExternalRef")

I get an exception 
com.microsoft.sqlserver.jdbc.SQLServerException: The multi-part identifier
"t.id" could not be bound.

If I hard-code it works fine:
.to("sql:select t.event from events t where t.id= '1234' ")

This seems specific to sql server driver, it works when using the jTDS
driver.



--
View this message in context: http://camel.465427.n5.nabble.com/camel-sql-joined-query-with-parameters-won-t-run-on-sql-server-tp5784402p5785280.html
Sent from the Camel - Users mailing list archive at Nabble.com.