If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem calling procedure from function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-06, 02:36
Syncho Syncho is offline
Registered User
 
Join Date: May 2006
Posts: 5
Problem calling procedure from function

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On