Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to query the database version? 1

Status
Not open for further replies.

GaryAshford

Programmer
Joined
Jan 2, 2002
Messages
28
Location
GB
Hi again.

With most other DBMSs, it is possible to interrogate the database (a table or a function) to establish the database version, etc being used. Is this possible with Informix Databases?

TIA
Gary
 
Gary:

Two ways I've used in the past:

1) Look at one of the system tables, sysmaster:

select owner from systables where tabname matches "*VERSION*"

However, I don't trust it as I've seen it not give the right vesion.

2) I always rely on the output of the informix utility, onstat. In a shell script, this gives you the right version:

onstat -|awk ' { print $5 }'

I realize step 2) wasn't what you asked for.

Regards,

Ed
 
Thanks very much for your reply (again!)

Gary
 
Gary:

You're welcome (again). Thanks for the star.

Ed
Schaefer
olded@ix.netcom.com
 
Hi:

I know this is an old thread, but I've just discovered that if you have 7.3x of the engine, you can use DBINFO function to obtain the version, so I thought I'd share it with you.

To obtain version info in various forms:

1) return the full server name:

SELECT DBINFO("version", "full") FROM systables where tabname = "systables"

returns

Informix Dynamic Server Version 7.31.UC2

2) return the major version

SELECT DBINFO("version", "major") FROM systables where tabname = "systables"

returns

7

3) return the minor version

SELECT DBINFO("version", "minor") FROM systables where tabname = "systables"

returns

31

4) return the level version

SELECT DBINFO("version", "level") FROM systables where tabname = "systables"

returns UC2

5) return the operating system type:

U = Unix 32 bit running on a 32-bit OS
H = Unix 32 bit running on a 64-bit OS
F = Unix 64 bit running on a 64-bit OS
T = Windows NT

SELECT DBINFO("version", "os") FROM systables where tabname = "systables"

on my system, returns:

U


 
Thanks very much- this is gold dust.
-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top