View Single Post

   
  #3 (permalink)  
Old 02-27-2008, 05:42 AM
Knut Stolze
 
Posts: n/a
Default Re: Equivalence for Sybase Functions in DB2

pankaj_wolfhunter@yahoo.co.in wrote:

> Greetings,
> In Sybase there are some functions for which i am not
> able to find any equivalent in DB2.
>
> 1)
>
> DESCRIPTION: To obtain the database name one is currently logged into.
>
> QUERY
> 1> select db_name()
> 2> go
>
> RESULT
>
> pubs2



The name of the database can be found in the CURRENT SERVER special
register:

VALUES CURRENT SERVER

> 2)
>
> DESCRIPTION: To obtain the database id one is currently logged into
> QUERY
> 1> select db_id()
> 2> go
>
>
> RESULT
> ------
> 4


DB2 doesn't have such an id for database. The name is the identifier.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Reply With Quote