Camel SQL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel SQL

dpravin
Hi,

I am trying to invoke a select count(*) from table1 or select count(pk_id) from table1. I am using SQL and do get the result in the body in following format,

[{COUNT(*)=10}] or [{COUNT(PK_ID)=10}]. I would like to use the response to do some conditional routing. How do I get the result from the body and use it as following for conditional routing,

count(*)>=1

Thanks,
P
- Pravin
Reply | Threaded
Open this post in threaded view
|

Re: Camel SQL

fabryprog
If you execute your query using alias (count(*) as c) you can use simple EL.

http://camel.apache.org/simple.html

The query result is into body input message

For example: ${body[c]}. It is a list of hashmap object.