Skip to content

component sql

assimbly edited this page May 20, 2022 · 6 revisions

The SQL component lets you query a database.

Path

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.

Path Examples

Select Example

For a table named 'order' just add the following SQL

SELECT orderid,amount FROM order

Insert Example

Insert the value orderid=1 and amount=1000

INSERT INTO order(orderid,amount) VALUES (1,1000)

Call Example

For calling a stored procedure with parameter=20

CALL PROCEDURENAME(20)

Headers

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)

Connection

In order to make a connection to the database you first need to create a JDBC connection. This connection is required.

Screenshots

SQL_STOREDPROCEDURE

Common options

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.

Clone this wiki locally