Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql error code 818

Status
Not open for further replies.

Yan302

Programmer
Feb 9, 2009
7
BE
Hi all,

I've got sql error code 818 and I don't understand why.

Here is the sequence of commands I ran:

("cl" is the compiler of Microsoft Visual Studio)

db2 connect to sample

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

db2 prep gdk_PERSONZ.sqc bindfile
db2 bind gdk_PERSONZ.bnd
cl -Zi -LD /DDKTARGET_NT -I. -I../runtime -I/include -c gdk_PERSONZ.c

db2 prep gdk_POLY.sqc bindfile
db2 bind gdk_POLY.bnd
cl -Zi -LD /DDKTARGET_NT -I. -I../runtime -I/include -c gdk_POLY.c

db2 prep gdk_PZZY.sqc bindfile
db2 bind gdk_PZZY.bnd
cl -Zi -LD /DDKTARGET_NT -I. -I../runtime -I/include -c gdk_PZZY.c

db2 prep gdk_tables.sqc bindfile
db2 bind gdk_tables.bnd
cl -Zi -LD /DDKTARGET_NT -I. -I../runtime -I/include -c gdk_tables.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"(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?

Any idea or help is welcome.

Thanks in advance,

Yan
 
Hi all again,

I've found the problem. The package name in DB/2 are limited to 8 characters. So there were a conflit between gdk_PERS(ON) and gdk_PERS(ONZ).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top