Invoke SQL function

Hi Guys,

I would like to call Oracle SQL function (that returns a value) in JDBC Adapter service.

Used Stored Proc template, but it errored out as below.

PLS-00221: ‘ADD_NUMBERS’ is not a procedure or is undefined

I then used Dynamic SQL template with the query as below.

declare
result NUMBER;
begin
result := ADD_NUMBERS(1,2);
end;

specified output param as ‘result’. But it threw below error.

(99999/17003) Invalid column index.

When I run this function in SQL developer console, it runs successfully. So I am suspecting some syntax mistakes when running the same query from dynamic SQL adapter service.

Can you please advise how to invoke a function by passing input params to it and capturing the returned value into the adapter service’s output params.

Kind regards,
Raj

Give a try like below one.

select function({param1}, {param2}) as output from dual