Let's consider for instance the following db function:
One might think to run this camel route in order to call the mentioned db function:
but SqlCall build incorect query:
which fail on wrong number of arguments. After an investigation is found out that first parameter was skipped for function calls.
So one might try to add one parameter which should be used as output for return statement. But the only valid format of parameter (for db functions) seems to be InputParameter which is not possible to use as output for result.
If OutputParameter are used than this https://github.com/apache/camel/blob/master/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/TemplateStoredProcedure.java#L77 will force to create SQL procedure call (instead of a function one), for instance this:
results in this query call: