You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Matt Payne <Pa...@MattPayne.org> on 2014/03/18 22:00:53 UTC

Question: generated keys and SQL component

Greetings!   Would you please help me find an example of using the SQL[1]
component and inserting into a table where the primary key is automatically
generated?   This is documented as possible with the JDBC component[2,3]:

"If you insert data using SQL INSERT, then the RDBMS may support auto
generated keys. You can instruct the
JDBC<http://camel.apache.org/jdbc.html> producer
to return the generated keys in headers.
To do that set the header CamelRetrieveGeneratedKeys=true. Then the
generated keys will be provided as headers with the keys listed in the
table above."

I am using SQL[1] component rather than JDBC[2] component because the SQL
component works with transactions.

Would you please help me find an example of using the SQL[1] component and
inserting into a table where the primary key is automatically generated?

Thanks! --Matt Payne

[1] http://camel.apache.org/sql-component.html
[2] http://camel.apache.org/jdbc.html
[3]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcGeneratedKeysTest.java

Re: Question: generated keys and SQL component

Posted by Matt Payne <ma...@gmail.com>.
Thank you!—
Sent from Mailbox for iPhone

On Thu, Mar 20, 2014 at 3:10 AM, Claus Ibsen <cl...@gmail.com>
wrote:

> I logged a ticket
> https://issues.apache.org/jira/browse/CAMEL-7313
> On Wed, Mar 19, 2014 at 11:18 AM, Claus Ibsen <cl...@gmail.com> wrote:
>> Hi
>>
>> Don't think we support returning generated keys in camel-sql. Feel
>> free to log a JIRA ticket
>>
>>
>> On Tue, Mar 18, 2014 at 10:00 PM, Matt Payne <Pa...@mattpayne.org> wrote:
>>> Greetings!   Would you please help me find an example of using the SQL[1]
>>> component and inserting into a table where the primary key is automatically
>>> generated?   This is documented as possible with the JDBC component[2,3]:
>>>
>>> "If you insert data using SQL INSERT, then the RDBMS may support auto
>>> generated keys. You can instruct the
>>> JDBC<http://camel.apache.org/jdbc.html> producer
>>> to return the generated keys in headers.
>>> To do that set the header CamelRetrieveGeneratedKeys=true. Then the
>>> generated keys will be provided as headers with the keys listed in the
>>> table above."
>>>
>>> I am using SQL[1] component rather than JDBC[2] component because the SQL
>>> component works with transactions.
>>>
>>> Would you please help me find an example of using the SQL[1] component and
>>> inserting into a table where the primary key is automatically generated?
>>>
>>> Thanks! --Matt Payne
>>>
>>> [1] http://camel.apache.org/sql-component.html
>>> [2] http://camel.apache.org/jdbc.html
>>> [3]
>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcGeneratedKeysTest.java
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> Make your Camel applications look hawt, try: http://hawt.io
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> Make your Camel applications look hawt, try: http://hawt.io

Re: Question: generated keys and SQL component

Posted by Claus Ibsen <cl...@gmail.com>.
I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-7313

On Wed, Mar 19, 2014 at 11:18 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Don't think we support returning generated keys in camel-sql. Feel
> free to log a JIRA ticket
>
>
> On Tue, Mar 18, 2014 at 10:00 PM, Matt Payne <Pa...@mattpayne.org> wrote:
>> Greetings!   Would you please help me find an example of using the SQL[1]
>> component and inserting into a table where the primary key is automatically
>> generated?   This is documented as possible with the JDBC component[2,3]:
>>
>> "If you insert data using SQL INSERT, then the RDBMS may support auto
>> generated keys. You can instruct the
>> JDBC<http://camel.apache.org/jdbc.html> producer
>> to return the generated keys in headers.
>> To do that set the header CamelRetrieveGeneratedKeys=true. Then the
>> generated keys will be provided as headers with the keys listed in the
>> table above."
>>
>> I am using SQL[1] component rather than JDBC[2] component because the SQL
>> component works with transactions.
>>
>> Would you please help me find an example of using the SQL[1] component and
>> inserting into a table where the primary key is automatically generated?
>>
>> Thanks! --Matt Payne
>>
>> [1] http://camel.apache.org/sql-component.html
>> [2] http://camel.apache.org/jdbc.html
>> [3]
>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcGeneratedKeysTest.java
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> Make your Camel applications look hawt, try: http://hawt.io



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Question: generated keys and SQL component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Don't think we support returning generated keys in camel-sql. Feel
free to log a JIRA ticket


On Tue, Mar 18, 2014 at 10:00 PM, Matt Payne <Pa...@mattpayne.org> wrote:
> Greetings!   Would you please help me find an example of using the SQL[1]
> component and inserting into a table where the primary key is automatically
> generated?   This is documented as possible with the JDBC component[2,3]:
>
> "If you insert data using SQL INSERT, then the RDBMS may support auto
> generated keys. You can instruct the
> JDBC<http://camel.apache.org/jdbc.html> producer
> to return the generated keys in headers.
> To do that set the header CamelRetrieveGeneratedKeys=true. Then the
> generated keys will be provided as headers with the keys listed in the
> table above."
>
> I am using SQL[1] component rather than JDBC[2] component because the SQL
> component works with transactions.
>
> Would you please help me find an example of using the SQL[1] component and
> inserting into a table where the primary key is automatically generated?
>
> Thanks! --Matt Payne
>
> [1] http://camel.apache.org/sql-component.html
> [2] http://camel.apache.org/jdbc.html
> [3]
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcGeneratedKeysTest.java



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io