Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

What is the connected database?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gregor Kovač - 15 Mar 2006 13:00 GMT
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

Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

| Gregor Kovac | Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
|            Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Knut Stolze - 15 Mar 2006 13:21 GMT
> 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" ;-))

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

Gregor Kovač - 15 Mar 2006 15:03 GMT
>> Hi!
>>
[quoted text clipped - 14 lines]
>
> (All my databases are named "TEST" ;-))

Yes!! Thanks...

What other special registers are there ? :)
Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

| Gregor Kovac | Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
|            Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Knut Stolze - 15 Mar 2006 15:04 GMT
> What other special registers are there ? :)

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

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

Shashi Mannepalli - 15 Mar 2006 18:09 GMT
Try this

db2 get connection state

cheers.....
Shashi Mannepalli
Gregor Kovač - 27 Mar 2006 09:46 GMT
> 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
Signature

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

| Gregor Kovac | Gregor.Kovac@mikropis.si    |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
|            Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.