I'm trying to use apache camel (sql component) to update the DB. Problem is that the DB just doesn't get updated. The sql:update is working fine when i hard code the query, but when i try to use ${body[0][id]} it doesn't update required field. Any feedback on what might be going wrong?
from("direct:updateSql")
.to("sql:select * from mytable limit 1")
.log("update mytable set status = '100' where id = '${body[0][id]}'")
.to("sql:update mytable set status = '100' where id = '${body[0][id]}'")
.end();
Note that status and id are integer fields but if i remove the ' from the .to() then i throws some errors.
According to the docs you must use
:#
as the placeholder syntaxSo try with