Hello,

I have a function which tries to access a temporary table in its body, but I'm getting the message that it's not possible. After a research I read I can do it in a procedure. So I decided to call a procedure from my function which accesses the table. But for some reason I'm getting the error SQL0374N The "MODIFIES SQL DATA" clause has not been specified in the CREATE
FUNCTION statement for LANGUAGE SQL function "my_func". When I put the clause I'm getting SQL0628N Multiple or conflicting keywords involving the "MODIFIES SQL DATA" clause are present. So what could be wrong with calling a sp from a function and what clauses should I use ? Here are my function and procedure definitions :

CREATE PROCEDURE myschema.my_proc(out param integer)
P1: BEGIN
set param = (select Lang_ID from SESSION.glb_sysinfo fetch first ROW ONLY);
if coalesce(param,0) <= 0 then
set param=1;
end if;
END P1

CREATE FUNCTION my_func()
RETURNS INTEGER
F1: BEGIN ATOMIC
declare ret integer;
call myschema.my_proc(ret);
return ret;
END

Thanks in advance