You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/04/25 09:43:39 UTC

[camel] branch main updated: CAMEL-19289: camel-sql - Add docs that SQL can use message body (simple language)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new ded98d80cf2 CAMEL-19289: camel-sql - Add docs that SQL can use message body (simple language)
ded98d80cf2 is described below

commit ded98d80cf287ec0348a67ae30e0b2b4617ae129
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 25 11:43:21 2023 +0200

    CAMEL-19289: camel-sql - Add docs that SQL can use message body (simple language)
---
 components/camel-sql/src/main/docs/sql-component.adoc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/components/camel-sql/src/main/docs/sql-component.adoc b/components/camel-sql/src/main/docs/sql-component.adoc
index 74388dabc70..30ac8a6d3dd 100644
--- a/components/camel-sql/src/main/docs/sql-component.adoc
+++ b/components/camel-sql/src/main/docs/sql-component.adoc
@@ -74,7 +74,18 @@ You can use xref:languages:simple-language.adoc[Simple] expressions as parameter
 sql:select * from table where id=:#${exchangeProperty.myId} order by name[?options]
 ----
 
-Notice that the standard `?` symbol that denotes the parameters to an
+And the xref:languages:simple-language.adoc[Simple] can also be used with POJO message bodies,
+to use getters for SQL parameters such as:
+
+----
+sql:insert into project (FIRST, LAST, CONTACT_MAIL)
+  values (:#${body.firstName}, :#${body.lastName}, :#${body.email})
+----
+
+TIP: See more details in xref:languages:simple-language.adoc[Simple] for more complex
+syntax that can be used in the SQL queries, than the small example above.
+
+IMPORTANT: Notice that the standard `?` symbol that denotes the parameters to an
 SQL query is substituted with the `pass:[#]` symbol, because the `?` symbol is
 used to specify options for the endpoint. The `?` symbol replacement can
 be configured on endpoint basis.