-
-
Notifications
You must be signed in to change notification settings - Fork 9
component sql
The SQL component lets you query a database.
query
Note: The query is just a normal SQL query like a select, insert or call. However you don't need the ;
to close the statement. Recommended is to first test the query with a SQL Client like DBeaver and then copy the SQL to Assimbly.
For a table named 'order' just add the following SQL
SELECT orderid,amount FROM order
Insert the value orderid=1 and amount=1000
INSERT INTO order(orderid,amount) VALUES (1,1000)
For calling a stored procedure with parameter=20
CALL PROCEDURENAME(20)
It's also possible to user header values in SQL queries. Check here to get more info on headers.
The insert example would then be
insert into order(orderid,amount) values (:#orderid,:#amount)
You can also put the whole body into a header. Then calling the stored procedure will be:
CALL PROCEDURENAME(:#body)
In order to make a connection to the database you first need to create a JDBC connection. This connection is required.
The option delay delay
is often set on the FROM endpoint. This sets the polling interval the query is executed.
For all options, see Camel documentation.