[ 
https://issues.apache.org/jira/browse/CAMEL-7455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14018534#comment-14018534
 ] 

Antoine DESSAIGNE commented on CAMEL-7455:
------------------------------------------

Hi Claus,

Here the 2 parts that I would add in the sql-component documentation, the text 
in italic helps you find I would insert this documentation.
_...If a named parameter cannot be resolved, then an exception is thrown._
>From Camel 2.14 onward you can use Simple expressions as parameters as shown
{code}
sql:select * from table where id=:#${property.myId} order by name[?options]
{code}
h4. Using expression parameters
*Available as of Camel 2.14*
In the given route below, we want to get all the project from the database. It 
uses the body of the exchange for defining the license and uses the value of a 
property as the second parameter.
{code}
from("direct:projects")
  .setBody(constant("ASF"))
  .setProperty("min", constant(123))
  .to("sql:select * from projects where license = :#${body} and id > 
:#${property.min} order by id")
{code}
----
As for the release note I would write
* Allow to define Simple expressions for sql parameters of the SQL component.

Antoine.

> supporting body in sql component
> --------------------------------
>
>                 Key: CAMEL-7455
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7455
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-sql
>    Affects Versions: 2.13.0
>            Reporter: Poyan Gerami
>            Assignee: Claus Ibsen
>             Fix For: 2.14.0
>
>
> Adding support for sending the body as one sql parameter:
> Answer from Claus in mailing list:
> Yeah for a single parameter, or just to refer to the body as is, or to
> allow using simple expressions, we could maybe look at adding support
> for that to the sql component,
> so eg :#body just refers to the body itself
> Or allow doing :#${body} and have a simple expression available, that
> gives you a bit more power.
> Though support for :#body is likely the easiest at first.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to