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. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~