473,770 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 PREP ... PACKAGE USING ... without implicit binding


Hi,

I've a problem:

I compile modules of embedded SQL (for a dynamic lib) on multiple
platforms (AIX,Linux,Wind ows). They are compiled from the same
source code. To be able to provide all platforms at the same time
on ONE database (server), I want different package names -
e.g. module1.sqc should produce packages AMOD1, LMOD1, and WMOD1.
So I tried the following db2 call for preparing:
DB2 PREP module1.sqc BINDFILE USING amod1.bnd PACKAGE USING amod1 [...]

It does all I want AND a little bit more: On DB2 V7 it binds the
newly created package implicitly! And that is a nightmare, because
I sometimes just compile the module, to be sure, that it is still
compilable on all platforms, after a changed a bit on one platform.

It there any way to name the package as I want/need, without binding it
in the same step???

Thanks for your help,
J. Luebbers

--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #1
17 7062
Jochen Luebbers wrote:

Hi,

I've a problem:

I compile modules of embedded SQL (for a dynamic lib) on multiple
platforms (AIX,Linux,Wind ows). They are compiled from the same
source code. To be able to provide all platforms at the same time
on ONE database (server), I want different package names -
e.g. module1.sqc should produce packages AMOD1, LMOD1, and WMOD1.
So I tried the following db2 call for preparing:
DB2 PREP module1.sqc BINDFILE USING amod1.bnd PACKAGE USING amod1
[...]

It does all I want AND a little bit more: On DB2 V7 it binds the
newly created package implicitly! And that is a nightmare, because
I sometimes just compile the module, to be sure, that it is still
compilable on all platforms, after a changed a bit on one platform.

It there any way to name the package as I want/need, without binding it
in the same step???


I don't know if this would help you but have a look at the LEVEL option (V8
also has a VERSION option) of the precompile command. That way, DB2 won't
use the timestamp of the package to verify that the package is in sync with
your source code.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
Knut Stolze <st****@de.ibm. com> wrote:
It there any way to name the package as I want/need, without binding it
in the same step???


I don't know if this would help you but have a look at the LEVEL option (V8
also has a VERSION option) of the precompile command. That way, DB2 won't
use the timestamp of the package to verify that the package is in sync with
your source code.


Hmm, that sounds good, I will see, if that will work for me.
Thanks for your hint.

J. Luebbers
--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #3
Now a have had a look at the LEVEL option. But unfortunately it is only
supported by DRDA servers :-(

But I need the different package names, to avoid platform conflicts.
The very last work around (for German readers: Würgherum!) would be
to rename the SQC file just before doing the DB2 PREP, but that is
not what I would like to do.

Has such a fine database like DB2 really no "normal" solution for
a problem like this?

Thanks again for all hints and help,
J. Luebbers
--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #4
If you issue your PREPO command with a bindfile parameter and NO package
parameter, you only get a bindfile and NO implicit bind.
You then have to take that bindfile (.bnd) and use in a bind command and
specify a specific package name (amod1, lmod1,...) for each specific
bind command.
So TRY the following db2 call for EACH prepare:
DB2 PREP module1.sqc BINDFILE USING amod1.bnd
DB2 PREP module1.sqc BINDFILE USING lmod1.bnd
DB2 PREP module1.sqc BINDFILE USING wmod1.bnd Then take each bind file to each of their target platform and issue the
BIND command there.

You can also write a script that checks the platform and binds the
proper file for it and then ship everything to all platforms.
I suspect that my DB2 V8.2 on XP has a few bindfiles that are not used
by it but shipped and installed as a genreal procedure.
HTH, Pierre.
Jochen Luebbers wrote: Hi,

I've a problem:

I compile modules of embedded SQL (for a dynamic lib) on multiple
platforms (AIX,Linux,Wind ows). They are compiled from the same
source code. To be able to provide all platforms at the same time
on ONE database (server), I want different package names -
e.g. module1.sqc should produce packages AMOD1, LMOD1, and WMOD1.
So I tried the following db2 call for preparing:
DB2 PREP module1.sqc BINDFILE USING amod1.bnd PACKAGE USING amod1 [...]

It does all I want AND a little bit more: On DB2 V7 it binds the
newly created package implicitly! And that is a nightmare, because
I sometimes just compile the module, to be sure, that it is still
compilable on all platforms, after a changed a bit on one platform.

It there any way to name the package as I want/need, without binding it
in the same step???

Thanks for your help,
J. Luebbers


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Nov 12 '05 #5
Pierre Saint-Jacques <se*****@attglo bal.net> wrote:
If you issue your PREPO command with a bindfile parameter and NO
package parameter, you only get a bindfile and NO implicit bind.
You then have to take that bindfile (.bnd) and use in a bind command
and specify a specific package name (amod1, lmod1,...) for each
specific bind command.
So TRY the following db2 call for EACH prepare:
> DB2 PREP module1.sqc BINDFILE USING amod1.bnd
> DB2 PREP module1.sqc BINDFILE USING lmod1.bnd
> DB2 PREP module1.sqc BINDFILE USING wmod1.bnd

Then take each bind file to each of their target platform and issue
the BIND command there.

The problem is *not* the bind-file name, but the *package name*.
If working as suggested, I will get different bind-files, sure,
but they all will bind *one* package named 'MODULE1'. That would
not be helpful, because I want to bind the different platform
packages at the *same* time and database.

J. Luebbers.
--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #6
Jochen Luebbers wrote:
Pierre Saint-Jacques <se*****@attglo bal.net> wrote:
If you issue your PREPO command with a bindfile parameter and NO
package parameter, you only get a bindfile and NO implicit bind.
You then have to take that bindfile (.bnd) and use in a bind command
and specify a specific package name (amod1, lmod1,...) for each
specific bind command.
So TRY the following db2 call for EACH prepare:
> DB2 PREP module1.sqc BINDFILE USING amod1.bnd
> DB2 PREP module1.sqc BINDFILE USING lmod1.bnd
> DB2 PREP module1.sqc BINDFILE USING wmod1.bnd

Then take each bind file to each of their target platform and issue
the BIND command there.

The problem is *not* the bind-file name, but the *package name*.
If working as suggested, I will get different bind-files, sure,
but they all will bind *one* package named 'MODULE1'. That would
not be helpful, because I want to bind the different platform
packages at the *same* time and database.


Then define an explicit package name using the PACKAGE option of the
PRECOMPILE command.
http://publib.boulder.ibm.com/infoce...e/r0001964.htm

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #7
Knut Stolze <st****@de.ibm. com> wrote:
Then define an explicit package name using the PACKAGE option of the
PRECOMPILE command.

....and we reach the point where I was starting. (see Subject:)

I used the PACKAGE option, but found that, it was binding in the same
step (as described in the documentation for V7).
And I disliked this for the described reasons.

Thanks for all your hints.

J. Luebbers
--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #8
Jochen Luebbers wrote:
Knut Stolze <st****@de.ibm. com> wrote:
Then define an explicit package name using the PACKAGE option of the
PRECOMPILE command.

...and we reach the point where I was starting. (see Subject:)

I used the PACKAGE option, but found that, it was binding in the same
step (as described in the documentation for V7).
And I disliked this for the described reasons.


I apologize, but I still don't understand the issue...

First, what's the problem with the implicit binding?
If you combine the various options (BINDFILE, PACKAGE, and LEVEL), you have:
- no collisions for the package names
- no collisions for the bind files
- no mismatches just because you change a bit in the code and left the SQL
statements alone (i.e. no timestamp conflicts)

So again, what's the problem with the implicit binding?

(This is a stupid question maybe: you do have a development system where you
do you precompilations and generate the bind files? So the implicit things
don't influence the production system anyway.
I don't want to present this as a "feature" - I just don't see a real
issue.)

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #9
Knut Stolze <st****@de.ibm. com> wrote:
First, what's the problem with the implicit binding? I want to be able to create (by now) up to three packages for the three
different platforms (AIX, Linux, and Windows) with the same database.
These packages should be usable at the same time with this database.
They are created from the same (or nearly the same) source code, but
in every case, they are created from the same source file.
I want to avoid a mechanism, that renames the source file just
before precompiling it. But at the same time I want to have unique
packages (to satisfy the above points).

So I tried a the command:
DB2 PREP module1.sqc BINDFILE USING amod1.bnd PACKAGE USING amod1

So far it did everything I wanted.
This module is part of a dynamic link library. I installed the lib, and
the programs used it - fine.

I went further in development and recompiled the module again -
and got failures from the users of the lib - because by DB2 PREP ... had
implicitly done the binding, thereby cutting of the lib with a -818
message.
Of course, it was my fault, not to read the docu carefully enough, that
I would have known about this.

I am told by the DBA, that the two database servers I develop for
are not DRDA servers (one on AIX, one on Linux). So the LEVEL option,
you pointed to, could not be used.
(This time I tried to read the docu more carefully. :-)

Or am I wrong, this there mistake in my conclusion?
(This is a stupid question maybe: you do have a development system where you
do you precompilations and generate the bind files? So the implicit things
don't influence the production system anyway.

The system is very small: Development and production are on the same
system with the same database. (Sorry, I did not tell this before.)

J. Luebbers
--
Jochen Lübbers lu******@tde-online.de
Software Development Group I TDE - Tele Data Electronic GmbH
"Who desire to give up freedom in order to gain security
will loose both in the end." (Benjamin Franklin)
Nov 12 '05 #10

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

Similar topics

1
2382
by: Analyst | last post by:
I'm trying to figure out how, from the Visual C++ GUI, to run a precompiler on my .SQC files, and create the corresponding .C files. I know about the DB2 command window, and how to do a DB2 PREP from there. That's not the information I'm looking for. I have a workspace set up in Developer Studio where some of the projects have ..SQC files, and others don't. I want to be able to build the whole workspace from the GUI. I don't want to...
17
4227
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset Set rs = Me.RecordsetClone rs.Find "=" & lngContractID If Not rs.EOF Then Me.Bookmark = rs.Bookmark I must site the Heisenberb Uncertainty Principal here, as it
21
3052
by: CBFalconer | last post by:
I released this under GPL some time ago, (2003-May) and have been advertising it occasionally here, where it seemed applicable. I have received no bug reports. I have just gotten around to writing a usage manual for it, which follows. I would like some opinions on it. Please don't quote the whole thing back at me, a short excerpt followed by your pithy commentary will do nicely. I am off for an operation Monday, so I won't be...
8
1829
by: Rich | last post by:
Hello, If I leave Option Strict Off I can use the following syntax to read data from a Lotus Notes application (a NotesViewEntry object represents a row of data from a Lotus Notes View - like a record in a sql Server view) .... Dim entry As Domino.NotesViewEntry Dim obj As Object str1 = entry.ColumnValues(0)
0
877
by: lakashya | last post by:
iam going to study for mcse , ccna and ocp in my next couple of month and i was looking for sites with package deals .... i came across hotcerts.com . anyone knows how good is their $85 all exams package and is it worth it ???? . looking for ur responses
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
6744
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, SPECTRAMIND SOLUTIONS now announces a new batch of Prep Courses for CSQA & CSTE& ISEB & ISTQB & Business Analyst & SOA so as to prepare you thoroughly for the most prestigious certification exams conducted by International organizations. We...
1
1975
by: gsgskms | last post by:
our code is written in C++ (unix) with SQL for connecting to db2 DB. we have dev (d30), systest(m30) schemas on same db (db2u). we need a solution to build once and use it on dev & systest environments. please suggest me some thing. we are totally stuck. we are using: db2 prep bindfile using abc.bnd qualifier d30 collection d30_col db2 bind abc.bnd qualifier d30 collection d30_col.
6
5685
by: crack.the.hack | last post by:
Hi All, If I am changing the database machine, what should I do not to prep bind the sqc files everytime. Because I need to build my application everytime the database is changed? Is there any way, to do prep bind with "defined timestamp" or something which does not require any prep - binding even when the
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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
10260
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...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
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...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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
4007
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
3
2850
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.