> running on AIX with DB2 v8.2.2
>
[quoted text clipped - 20 lines]
> similarity was causing the problem. I changed the names of the files
> so the first 8 char where unique and that solved my problem.
You can specify an explicit package name that is independent of the bind
file name at precompile/prep time.
> 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
[quoted text clipped - 17 lines]
> 8 char limitation....it does not state there is a character limitation
> in the BINDFILE name.
The limitation is on the package name only. The bind file can be as long as
you wish (or whatever the restrictions of you file system are). The thing
is if you do not give an explicit package name, DB2 will generate one for
you from the name of the bind file. That's all. And if _then_ the first 8
characters of the bind filename are not unique, you will get
collision/problems.
> So my question is, are the BINDFILE names also truncated?
No.
> 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?
The package names have to be unique. How you provide for that is up to you.
Either with an explicit package name using for the precompile command or by
omitting the package name and letting DB2 derive it from the bind filename.
Personally, I would recommend the use of an explicit package name as this
allows you to choose proper and speaking names for the bind files.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
shorti - 09 Feb 2006 18:40 GMT
Thanks for your response. Let me make sure i understand you correctly.
By not using "PACKAGE USING" in my precompile, a package is really
still being created but implicitly using the first 8 char of the source
file name (thus causing the problem where all three (packages begin
with upd_star). (this is what is confusing because the Reference guide
says " A package is not created unless the package option is also
specified").
So If I use the PACKAGE USING option in the precompile I can avoid the
problem when I name the packages as STACCESS, STUSING and STRECON even
though the source file names and bind file names remain similar:
upd_startaccessingdb.sqc
upd_startusingdb.sqc
upd_startreconproc.sqc
upd_startaccessingdb.bnd
upd_startusingdb.bnd
upd_startreconproc.bnd
Knut Stolze - 10 Feb 2006 07:12 GMT
> By not using "PACKAGE USING" in my precompile, a package is really
> still being created
The package will be created when you bind the bindfile against the database
in question.
> but implicitly using the first 8 char of the source
> file name (thus causing the problem where all three (packages begin
> with upd_star).
Correct.
> (this is what is confusing because the Reference guide
> says " A package is not created unless the package option is also
> specified").
During precompile, the package may or may not be created in the database you
precompile against depending on the options you are using. But that is not
an issue as the embedded SQL statements are all in the bind file. So when
deploying your application to the production (or development) system, you
will simply do a "db2 bind <bind file>". That will create (or update) the
package in the database.
If you don't use the PACKAGE option, the package is created implicitly - but
only in the one database that you used to prep against. And usually that's
a different database than production, so the bind is necessary anyways.
Summarized:
- db2 prep extracts the SQL statements from the embedded SQL source code and
places them in a bind file; you can choose pretty much any name for the
bind file
- db2 bind binds the bind file against a certain database to create the
package; during that bind, the SQL statements are actually verified,
compiled and optimized; the name of the package is restricted to 8 chars
and will be generated from the bind file name if not explicitly specified
> So If I use the PACKAGE USING option in the precompile I can avoid the
> problem when I name the packages as STACCESS, STUSING and STRECON even
[quoted text clipped - 7 lines]
> upd_startusingdb.bnd
> upd_startreconproc.bnd
Exactly.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany