Q

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.

==================================
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

Dig deeper on iSeries SQL commands and statements

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchEnterpriseLinux

SearchDataCenter

Close