473,799 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BINDFILE vs PACKAGE

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_startaccess ingdb.sqc
upd_startusingd b.sqc
upd_startreconp roc.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_startaccess ingdb.bnd
upd_startusingd b.bnd
upd_startreconp roc.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....i t 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?

Feb 9 '06 #1
3 2836
shorti wrote:
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_startaccess ingdb.sqc
upd_startusingd b.sqc
upd_startreconp roc.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_startaccess ingdb.bnd
upd_startusingd b.bnd
upd_startreconp roc.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.
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
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....i t 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.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 9 '06 #2
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_startaccess ingdb.sqc
upd_startusingd b.sqc
upd_startreconp roc.sqc

upd_startaccess ingdb.bnd
upd_startusingd b.bnd
upd_startreconp roc.bnd

Feb 9 '06 #3
shorti wrote:
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
though the source file names and bind file names remain similar:

upd_startaccess ingdb.sqc
upd_startusingd b.sqc
upd_startreconp roc.sqc

upd_startaccess ingdb.bnd
upd_startusingd b.bnd
upd_startreconp roc.bnd


Exactly.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Feb 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
12683
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck Gatto Dan Guzman Apr 27 2000, 12:00 am show options
3
1936
by: Petterson Mikael | last post by:
Hi, I have the following package names ( in an xml) that I will transform to html. I need to sort them. <package name="se.company.product.subproduct.boam.fpx.testsignals"> <package name="se.company.product.subproduct.boam.mao.iface.enum.hidden"> When I use <xsl:sort select="." order="ascending"/>
10
4857
by: datapro01 | last post by:
Running DB2 8.1.6A on AIX 5.1 We are experience package cache overflows. The high water mark for package cache is showing as 16,108,513 bytes, or approximately 3933 4K pages. The package cache size is set at Maxapples * 8 Maxapples is at 500.
6
2001
by: Page Horton | last post by:
I have a ASP.NET (VB) web application running. The DTS package is suppose to generates a flat file to a file path (aka: \\myStation\outputFiles\). When it runs it generates the following error on one of the steps (the others run successfully): Step 'Copy Data from Results to H:\Data\outfilename.txt Step' failed Step Error Source: Microsoft Data Transformation Services Flat File Rowset Provider Step Error Description:Error opening...
1
6736
by: Laurence | last post by:
Hi folks, In the middle of page 231 on the book "Administration Guide - Implementation" stated - "In addition to these package privileges, the BINDADD database privilege allows users to create new packages or rebind an existing package in the database." Previously, I think that the BIND package privilege is required for binding an existing package in the database, and the BINDADD database privilege is only for new package. Now, I'm...
0
6264
debasisdas
by: debasisdas | last post by:
PACKAGE WITH LOCAL FUNCTION ============================= create or replace package my_pkg as procedure my_proc(arg1 in varchar2); function my_fun(arg1 in number) return varchar2; end my_pkg; PACKAGE BODY
0
3880
debasisdas
by: debasisdas | last post by:
The following thread contains some useful tips/sample codes regarding PACKAGES in oracle, that the forum members may find useful. A package is a collection of procedures,functions,cursors,global variables etc. A package is also stored as an Object in the database. A package ha s two parts 1. Package-------------Specification. 2. Package body---Implimentaton.
0
3849
debasisdas
by: debasisdas | last post by:
SAMPLE PACKAGE EX#3 ==================== PACKAGE SPECIFICATION -------------------------------------------- CREATE OR REPLACE PACKAGE MYPACK AS PROCEDURE SHOWENAME(EMPID IN NUMBER); FUNCTION SHOWSAL(EMPID IN NUMBER) RETURN NUMBER; END MYPACK;
0
1923
by: Steven Samuel Cole | last post by:
Hi Stephane, thanks for your reply! :-) I do not get any notification or warning or whatever from dpkg, all output I get when running # sudo dpkg -i python-<package name>_0.0.1-4927-1_all.deb is Selecting previously deselected package python-<package name>. (Reading database ... 15026 files and directories currently installed.)
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.