i am having some problems with a very simple UDF function writen in C.
I have compiled the c file into a DLL ( used Dev-C++ ) an copyed the dll into functions directory ( C:\Program Files\IBM\SQLLIB\FUNCTION\ ). When i run the function ( VALUES(CLOBCOMP(CLOB('A'),CLOB('A'))) ) i get the following error:
SQL0444N Routine "XX.CLOBCOMP" (specific name "CLOBCOMP") is implemented with code in library or path "\ClobComp", function "ClobComp" which cannot be accessed. Reason code: "6". SQLSTATE=42724
Code example C:
Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- #include <string.h>
- #include <sqludf.h>
- #if defined(__cplusplus)
- extern "C"
- #endif
- void SQL_API_FN ClobComp( SQLUDF_CLOB *clob_1, SQLUDF_CLOB *clob_2, SQLUDF_INTEGER *int_1, SQLUDF_TRAIL_ARGS)
- {
- *int_1 = 0;
- if (clob_1 == clob_2) {
- *int_1 = 1;
- }
- return;
- }
Expand|Select|Wrap|Line Numbers
- CREATE FUNCTION CLOBCOMP( CLOB(2M), CLOB(2M))
- RETURNS INTEGER
- EXTERNAL NAME 'ClobComp!ClobComp'
- SPECIFIC CLOBCOMP
- LANGUAGE C
- PARAMETER STYLE DB2SQL
- DETERMINISTIC
- NOT FENCED THREADSAFE
- NO SQL
Expand|Select|Wrap|Line Numbers
- Path=C:\Program Files\IBM\SQLLIB\BIN;C:\Program Files\IBM\SQLLIB\FUNCTION;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syst
- em32\Wbem;C:\Program Files\Common Files\Lenovo;C:\Program Files\Lenovo
- \Client Security Solution;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\
- Microsoft Visual Studio 9.0\VC\bin\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL
- Server\100\DTS\Binn\;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\;C:\Program Files\OpenVPN\bin
Any help will be very apriciated.
best regards,
Marko