Hard to say without looking at your function definition and invocation, but if I had to guess, I'm guessing that your function has a character input parameter that's causing the problem. The problem is actually caused by the fact that SQL casts all character string constants to the VARCHAR data type. However, the VARCHAR type is not promotable to the CHAR type in DB2's data type promotion rules, so the function call is not compatible with the function definition. Thus, usually you can solve the problem by changing the function parameter to a VARCHAR or casting your input parameter to a character datatype (eg, Function1(CHAR('ABC')) )
You can find more details here.
================================== MORE INFORMATION ON THIS TOPIC ==================================
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: tips, tutorials and more.
Check out this online event, Getting the Most out of SQL & DB2 UDB for the iSeries.
This was first published in May 2003