cl -Zi -LD /DDKTARGET_NT /MD /Fedbntry.dll ../runtime/dk_dllentry.obj gen/runtime/gdk.lib ../lib/datakom.lib "C:\Program Files\IBM\SQLLIB\lib\db2api.lib"(which create a dll named dbntry.dll)
Then, I've got a COBOL program (compiled with Microfocus products) that uses this dll making access to the database. This database contains 4 tables: PERSON, PERSONZ, POLY and PZZY).
If in the COBOL program I run a command on the PERSON table, I got sqlcode error 818 ; but if I run the same command on table PERSONZ it goes well.
I found that this error occurs when the timestamps generated by the precompiler and the "binder" are not the same so I've tried to precompile/bind/compile/link again, but only things that refer to PERSON:
db2 prep gdk_PERSON.sqc bindfile
db2 bind gdk_PERSON.bnd
cl -Zi -LD /DDKTARGET_NT -I. -I../runtime -I/include -c gdk_PERSON.c
lib /OUT:gdk.lib gdk_PERSON.obj gdk_PERSONZ.obj gdk_POLY.obj gdk_PZZY.obj gdk_tables.obj
cl -Zi -LD /DDKTARGET_NT /MD /Fedbntry.dll ../runtime/dk_dllentry.obj gen/runtime/gdk.lib ../lib/datakom.lib "C:\Program Files\IBM\SQLLIB\lib\db2api.lib"
and so it goes well on table PERSON but no more on table PERSONZ.
I'm completely disappointed about this problem. Does someone see a trouble in the command sequence I used?
My guess is "int" or "gnt". Try to compile the cobol to an object and link this together with the C dll's to 1 ".exe".
Another option, more complex I'm afraid, if to link your modules into your MF runtime environment.
The link with the dll is not necessary. At the execution if we have a call to "DBNTRY" and that there is no DBNTRY procedure in the cobol code, a dbntry.dll file is searched by the runtime of microfocus.
The same sequence of commands has been tested with oracle and mySql without error. So it seems that the problem come from a DB2 specificity that I don't know.