I am trying to call a SQL Function from my Java code but I have no luck in this. I know I need to use Callable Statement to call the SQL function but I am not sure about the function what values it will yield as a result since I am new to SQL and I am having hard time understanding the SQL function.
Below is my SQL function.
SQL function:
FUNCTION FXRATE_ENTITY(CODCURRBASE IN VARCHAR, LCODCURRFROM IN VARCHAR, LCODCURRTO IN VARCHAR, LIDENTITY IN VARCHAR)
RETURN NUMBER IS
CODCUR_L VARCHAR2(3);
BEGIN
IF (LCODCURRTO = '*') THEN
RETURN NVL(FXRATE(CODCURRBASE, LCODCURRFROM, CODCURRBASE, LIDENTITY),
0);
ELSE
RETURN NVL(FXRATE(CODCURRBASE, LCODCURRFROM, LCODCURRTO, LIDENTITY), 0);
END IF;
END;
You could try something like this: