DB2中Sybase函数的等效性 [英] Equivalence for Sybase Functions in DB2

查看:76
本文介绍了DB2中Sybase函数的等效性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,

在Sybase中有一些函数,我不能在$ DB2中找到任何等价物。


1)


描述:要获取数据库名称,目前已登录。


QUERY

1 GT; select db_name()

2> go


结果


pubs2


(受影响的一排)

/>
2)


描述:要获取数据库ID,目前已登录

QUERY

1> ; select db_id()

2> go

结果

------

4


(受影响1行)


3)


描述:检索数据库服务器所在的主机ID

运行

QUERY

1> select host_id()

2> go

结果

---------------------

8746


(1行受影响)


4)


描述:检索数据库服务器的名称

QUERY

1> select host_name()

2> go


结果

-----------------------

ps-server1

(受影响的一排)

任何帮助将不胜感激


TIA

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

(1 row affected)

2)

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

(1 row affected)

3)

DESCRIPTION: To retrieve the host id on which the database server is
running
QUERY
1> select host_id()
2> go
RESULT
---------------------
8746

(1 row affected)

4)

DESCRIPTION: Retrieves the name of the database server
QUERY
1> select host_name()
2> go

RESULT
-----------------------
ps-server1

(1 row affected)
Any help would be greatly appreciated

TIA

推荐答案

pa *************** @ yahoo.co.in 写道:
问候,
在Sybase中有一些函数,我不能在DB2中找到任何等价物。

1)

描述:要获取数据库名称,目前已记录一个进入。

QUERY
1> select db_name()
2> go

结果

pubs2

(1排受影响)

2)

描述:要获取数据库ID,目前已登录到
QUERY
1> select db_id()
2> go

结果
------
4

(1排受影响)

3)

描述:检索数据库服务器正在运行的主机ID
QUERY
1> select host_id()
2> go

结果
---------------------
8746

(1受影响的行)

4)

说明:检索数据库服务器的名称
QUERY
1> select host_name()
2> go

结果
-----------------------
ps-server1

(1排受影响)

任何帮助将不胜感激

TIA
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

(1 row affected)

2)

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

(1 row affected)

3)

DESCRIPTION: To retrieve the host id on which the database server is
running
QUERY
1> select host_id()
2> go
RESULT
---------------------
8746

(1 row affected)

4)

DESCRIPTION: Retrieves the name of the database server
QUERY
1> select host_name()
2> go

RESULT
-----------------------
ps-server1

(1 row affected)
Any help would be greatly appreciated

TIA



您使用的是哪个版本/修订包。

有一些像GET_ENV_INFO()这样的表函数可以返回一些

的东西。

当你使用eteh SQLCA返回数据库名称连接。

还有其他有趣的功能,比如SNAPSHOT_ *函数,它可以转储dbnme。如果全部失败,我认为DBINFO结构应该包含dbname(Java或C函数的几行将使得它可以通过SQL访问。

可以通过SQL访问。


干杯

Serge


-

Serge Rielau

DB2解决方案开发

适用于Linux,Unix,Windows的DB2 UDB

IBM多伦多实验室


Which version/fixpack ar eyou on.
There are some table functions like GET_ENV_INFO() which return some of
the stuff.
The DB name is returned with eteh SQLCA when you connect.
There are other interesting fucntions like the SNAPSHOT_* function which
may dump the dbnme. If all fails I think teh DBINFO structure should
contain the dbname (a couple of lines of a Java or C function will make
it accessible through SQL.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab


PA *************** @ yahoo.co.in 写道:
pa***************@yahoo.co.in wrote:
问候,
在Sybase中有一些函数我无法在DB2中找到任何等价物。

1)

说明:要获取数据库名称,目前已登录。

QUERY
1> select db_name()
2> go

结果

pubs2



数据库的名称可以在CURRENT SERVER特别版中找到/>
注册:


VALUES CURRENT SERVER

2)

说明:要获取数据库ID,一个是目前登录
QUERY
1> select db_id()
2> go

结果
------
4
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没有这样的id对于数据库。名称是标识符。


-

Knut Stolze

DB2信息集成开发

IBM德国



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

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


Serge:我不知道修复包但我在windows上使用db2 v8.2

平台。

关于你刚刚指定的功能,我在哪里可以找到一些工作

的例子?

你可以帮忙吗。


Knut:感谢您的信息。

Serge: I dont know about the fixpack but i am using db2 v8.2 on windows
platform.
About the functions u just specified, where can i find some working
examples on them?
Can u help with that.

Knut: thanks for the info.


这篇关于DB2中Sybase函数的等效性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆