I have written a user SQL function in which I make a call to a C program. When I try to use it, I obtain an SQL error SQL0204. If I look at SYSFUNCS view, the sql_path contains '*libl'. I have V5R1 with the latest cum. Can you help me?
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.
Dig deeper on iSeries SQL commands and statements
Related Q&A from Kent Milligan
To monitor members stuck within a physical file on AS/400, you can periodically use the display file description (DSPFD) command to create an output ...continue reading
Create a host variable of the where in statement on the fly with dynamic SQL.continue reading
When working with DB2 files with columns that have both short and long names, there is no option choose which column names are returned via ODBC ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.