We are just now experimenting with 8.2 so we have not tried this yet. I looked at the grammar for CREATE FUNCTION because of the error message you posted. I think you need to move the RETURNS clause like this:
CREATE FUNCTION function1( p_dsc_ctx VARCHAR(7) ,
MODIFIES SQL DATA
I think i found the reason of my problem, i put the same name for the procedure, function and the global temporary table that the procedure reads i think db2 don't know in this case what are the statement he'll call, i change the name of then and db2 permits me to compile then.
It is hard to believe that db2 will be confused when using same name for a routine ,a function and a table .. Each one of them is a different type of object and used in a different fashion ... So, it has to be something else ...
I have used UDFs and SPs with the same name before
Visit the new-look IDUG Website , register to gain access to the excellent content.