473,503 Members | 9,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the connected database?

Hi!

How can I determine the name of a database I'm connected to.
I tried the SNAP_GET_DB, SNAPSHOT_DATABASE, ... but all these return all
databases that are defined as "Indirect" or "Home" in LIST DATABASE
DIRECTORY command. This is not the desired behaviour.

Any ideas?

Best regards,
Kovi

--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac | Gr**********@mikropis.si |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Mar 15 '06 #1
5 1533
Gregor KovaÄŤ wrote:
Hi!

How can I determine the name of a database I'm connected to.
I tried the SNAP_GET_DB, SNAPSHOT_DATABASE, ... but all these return all
databases that are defined as "Indirect" or "Home" in LIST DATABASE
DIRECTORY command. This is not the desired behaviour.


Query the CURRENT SERVER special register:

$ db2 values current server

1
------------------
TEST

1 record(s) selected.

(All my databases are named "TEST" ;-))

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Mar 15 '06 #2
Knut Stolze wrote:
Gregor Kovač wrote:
Hi!

How can I determine the name of a database I'm connected to.
I tried the SNAP_GET_DB, SNAPSHOT_DATABASE, ... but all these return all
databases that are defined as "Indirect" or "Home" in LIST DATABASE
DIRECTORY command. This is not the desired behaviour.


Query the CURRENT SERVER special register:

$ db2 values current server

1
------------------
TEST

1 record(s) selected.

(All my databases are named "TEST" ;-))

Yes!! Thanks...

What other special registers are there ? :)
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac | Gr**********@mikropis.si |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Mar 15 '06 #3
Gregor KovaÄŤ wrote:
What other special registers are there ? :)


Quite a few: http://tinyurl.com/porln

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Mar 15 '06 #4
Try this

db2 get connection state
cheers.....
Shashi Mannepalli

Mar 15 '06 #5
Shashi Mannepalli wrote:
Try this

db2 get connection state
cheers.....
Shashi Mannepalli


Hi!

VALUES(CURRENT_SERVER) is a better wys, since I can run this as SQL
statement.

Best regards,
Kovi
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac | Gr**********@mikropis.si |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Mar 27 '06 #6

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

Similar topics

5
3023
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
1
1411
by: Franz-Josef | last post by:
Hello all, I have a scripts which needs the information about the database in which it is running. How can I find out this information. For example if I want to know the User who has...
3
1982
by: E. W via DotNetMonster.com | last post by:
Hi all, is it possible to get the numer of users, who are connected at the same time to the specified SQL Database and how do I get this Information? thanks EW -- Message posted via...
1
1937
by: dejavue82 | last post by:
Hello fellow programmers! My question concerns the scalability of database access. In coldfusion (or php for that matter) for example, there seems to be only the connected model for accessing a...
3
1449
by: mminnie | last post by:
After years of working with legacy systems, I am not starting to discover the .NET world. Wow. I am trying to figure out how Visual Basic, Windows Forms, Smart Clients, and all of the other .NET...
5
12236
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
0
1274
by: Hetal | last post by:
Hi.. I have a VB.NET (Windows forms) application and i would like to determine the type of database (SQL/MySQL/Access) i am connected to. In native VB6, say i have a connection object named...
4
7900
by: Vivek | last post by:
Hi, Generally we work with the 2 part qualified table names in db2 i.e. <schema>. <table name> Is there a more fully qualified table name ? I've seen that a select from <database...
11
1550
by: James R. Davis | last post by:
Yes, a newbie here. Though I am making progress, slowly, I am also getting more and more confused. With ASP, when I wanted to do something as trivial as updating a visitor counter, I...
0
7207
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
7294
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,...
0
7361
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...
1
7015
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
5602
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,...
1
5026
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...
0
3183
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...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
403
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...

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.