Get started Bring yourself up to speed with our introductory content.

Why do I keep getting SQL error SQL0204?

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.


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