473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Get Version Level in cpp

I am trying to find a way to determine the DB2 version level through
c++. I only found one way through IBM's website and i would have to
connect to a db first. I will have to check versions on systems that
do not yet have a database. My applications will be used for creating
db's, backing them up, restoring them, and upgrading data.
Does anyone know a way to get this information without a db connection?
I can use either C++ or C#

Nov 12 '05 #1
2 1556
If you can execute an external program, try calling "db2level". This
program writes information about the service level to stdout. You'll
need to establish an appropriate UDB environment before executing it.

Phil Sherman
kc*****@gmail.com wrote:
I am trying to find a way to determine the DB2 version level through
c++. I only found one way through IBM's website and i would have to
connect to a db first. I will have to check versions on systems that
do not yet have a database. My applications will be used for creating
db's, backing them up, restoring them, and upgrading data.
Does anyone know a way to get this information without a db connection?
I can use either C++ or C#

Nov 12 '05 #2
kc*****@gmail.com wrote:
I am trying to find a way to determine the DB2 version level through
c++. I only found one way through IBM's website and i would have to
connect to a db first. I will have to check versions on systems that
do not yet have a database. My applications will be used for creating
db's, backing them up, restoring them, and upgrading data.
Does anyone know a way to get this information without a db connection?
I can use either C++ or C#


You can use the sqleatin function to attach to an instance. This function
uses a SQLCA structure to return inforamtion about the attachment operation
to the caller. If the attachment was successful, the "sqlerrp" attribute
of the structure contains the identifier of the version that the instance
in question uses:

Breakpoint 1, main () at a.c:10
10 rc = sqleatin("stolze", "stolze", "********", &ca);
(gdb) n
11 printf("result: %d\n", rc);
(gdb) print ca
$1 = {sqlcaid = "SQLCA ", sqlcabc = 136, sqlcode = 0, sqlerrml = 46,
sqlerrmc = "11208STOLZE STOLZEQDB2/LINUX28928901", ' ' <repeats 24
times>, sqlerrp = "SQL08023", sqlerrd = {0, 0, 0, 0, 0, 0},
sqlwarn = ' ' <repeats 11 times>, sqlstate = "00000"}
(gdb)
Probably there is another way to get the information. Have a look at the
administrative APIs.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #3

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

Similar topics

16
by: Manlio Perillo | last post by:
Hi. I'm a new user of Python but I have noted a little problem. Python is a very good language but it is evolving, in particular its library is evolving. This can be a problem when, ad example,...
3
by: Alex Stapleton | last post by:
Whenever I run python I get "Warning! you are running an untested version of Python." prepended to the start of any output on stdout. This is with Debian and python 2.3 (running the debian...
1
by: Ralph Krausse | last post by:
What is the latest version of javascript? 1.2? Who manages this? NetScape? Who comes out with new versions? How does these changes get into Netscape and Explorer? How can I find what browsers...
8
by: DB2SQL | last post by:
What would be the best way to obtain a DB2 UDB (major) version for particular DB2 database, preferably by the C language style API. I have to develop a client application that first has to figure...
1
by: stanger | last post by:
Hello, I've been trying and searching for a way to detect if SQL Server exists on the computer, and, most importantly, detect SQL Server's version and service pack level, but no luck to this...
1
by: Harry Simpson | last post by:
I know I drilled down into the Windows folder\Microsoft.net\Framework\v1.1.4322 folder and looked at the version of Mscorcfg.dll to get the SP level from the version number: Mine shows...
9
by: shorti | last post by:
I reviewed a similar post on an older version of DB2. I was wondering if there was anything available now that is more precise in gathering the db2 version for the new v8 calls. I am running...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
5
by: Frank Swarbrick | last post by:
Has anyone come upon this problem? My DB2/LUW 9.1 database seems to be both "started and not started". Check out the following: C:\Program Files\IBM\SQLLIB\BIN>db2 connect to sample SQL1032N ...
15
by: bg_ie | last post by:
Hi, I have the following class - class TestOutcomes: PASSED = 0 FAILED = 1 ABORTED = 2 plus the following code -
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.