running on AIX with DB2 v8.2.2
I ran across a problem with naming source files with similar names.
For instance, if I have these three files:
upd_startaccessingdb.sqc
upd_startusingdb.sqc
upd_startreconproc.sqc
and I precompile like so:
-db2 PREP $*.sqc BINDFILE USING $(MADE)$*.bnd OUTPUT $(MADE)$*.cc
MESSAGES $(MADE)$*.msg
I end up with bindfiles:
upd_startaccessingdb.bnd
upd_startusingdb.bnd
upd_startreconproc.bnd
In the precompile area I read that db2 only uses the first 8 char of
the source file name when packaging so my conclusion was the name
similarity was causing the problem. I changed the names of the files
so the first 8 char where unique and that solved my problem.
Now, I want a way to bypass the problem by renaming the packages. My
confusion came when I read further. This is the info from the DB2
Reference:
1) BINDFILE - Results in the creation of a bind file. A package is not
created unless the package option is also specified...... If a file
name is not entered, the precompiler uses the name of the program
(entered as the filename parameter), and adds the .bnd extension.
2) PACKAGE - Creates a package. If neither package, bindfile, nor
syntax is specified, a package is created in the database by default.
USING package-name
The name of the package that is to be generated by the precompiler. If
a name is not entered, the name of the application program source file
(minus extension and folded to uppercase) is used. Maximum length is 8
characters.
Reading this it seems that a 'PACKAGE' is not being created since my
PREP does not contain the PACKAGE option. Also, only PACKAGE shows the
8 char limitation....it does not state there is a character limitation
in the BINDFILE name.
So my question is, are the BINDFILE names also truncated? so if I just
change the bindfile name to something unique will that resolve the
problem or do the PACKAGE names still come to play even though the
option is not used?