简体   繁体   English

为什么在执行以下查询时出现错误SQLCODE = -204,SQLSTATE = 42704,DRIVER = 4.18.60

[英]Why I got error SQLCODE=-204, SQLSTATE=42704, DRIVER=4.18.60 in execuing below query

When I run: 当我跑步时:

select * from sys.server_role_members ;

got below error: 出现以下错误:

SQLCODE=-204, SQLSTATE=42704, DRIVER=4.18.60

As you seem to be a beginner, you need to know that when asking for help with Db2, it is important to always write your Db2-version and the Db2-server operating system (Z/OS, i-Series(formerly AS/400), or Linux/Unix/Windows ). 您似乎是个初学者,您需要知道在寻求Db2帮助时,务必始终编写Db2版本和Db2服务器操作系统(Z / OS,i系列(以前为AS / 400) ),或Linux / Unix / Windows)。 That's because the three platforms have different capabilities and sometimes the SQL is different also, and the catalog is different. 这是因为这三个平台具有不同的功能,有时SQL也不同,目录也不同。

You get that error because your query is meant for Microsoft SQL-Server databases only. 之所以会出现该错误,是因为查询仅适用于Microsoft SQL-Server数据库。

Your query cannot work on Db2 because Db2 does not allow user-created schema names to begin with SYS. 您的查询无法在Db2上运行,因为Db2不允许用户创建的架构名称以SYS开头。 Some IBM-created schema-names can start with SYS for example SYSIBM and SYSCAT but these are reserved for the catalog and they get created by Db2 during database creation. 一些IBM创建的模式名称可以以SYS开头,例如SYSIBM和SYSCAT,但是它们是为目录保留的,它们由Db2在数据库创建期间创建。

Db2 has tables like SYSIBM.SYSROLEAUTH and SYSIBM.SYSROLES and (on Linux/Unix/Windows) a set of views on these in the SYSCAT schema. Db2具有SYSIBM.SYSROLEAUTH和SYSIBM.SYSROLES之类的表,并且在SYSCAT模式中具有(在Linux / Unix / Windows上)这些表的一组视图。

For example, if your Db2-server runs on Linux/Unix/Windows, then these views exist SYSCAT.ROLES and SYSCAT.ROLEAUTH . 例如,如果您的Db2服务器在Linux / Unix / Windows上运行,则这些视图存在SYSCAT.ROLESSYSCAT.ROLEAUTH

In addition, Db2 for Linux/Unix/Windows provides table function AUTH_LIST_AUTHORITIES_FOR_AUTHID which is quite useful. 另外,用于Linux / Unix / Windows的Db2提供了表功能AUTH_LIST_AUTHORITIES_FOR_AUTHID ,该功能非常有用。

If your Db2-server runs on i-Series, then different tables/views exist. 如果您的Db2服务器在i系列上运行,则存在不同的表/视图。 That's the reason you need to know which platform of Db2 you are using, and write that in your questions. 因此,您需要知道使用的是哪个 Db2 平台 ,并将其写在问题中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL错误:SQLCODE = -204,SQLSTATE = 42704,SQLERRMC = SYSCAT.COLUMNS,DRIVER = 3.54.54 - SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SYSCAT.COLUMNS, DRIVER=3.54.54 DB2 SQL错误:SQLCODE = -204,SQLSTATE = 42704 - DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704 为什么我使用DB2 LUW和WebSphere App Server获得SQLCODE = -204,SQLSTATE = 42704? - Why do I get SQLCODE=-204, SQLSTATE=42704 with DB2 LUW and WebSphere App Server? 错误信息 DB2 SQL 错误:SQLCODE=-204, SQLSTATE=42704, SQLERRMC=MCX28303.BANKACCOUNTS, DRIVER=4.26.14 - Error message DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=MCX28303.BANKACCOUNTS, DRIVER=4.26.14 松鼠存储导致文件错误SQLCODE = -204,SQLSTATE = 42704,SQLCODE = -514,SQLSTATE = 26501 - Squirrel store result in file error SQLCODE=-204, SQLSTATE=42704, SQLCODE=-514, SQLSTATE=26501 DB2 SQL 错误:连接到 db2 时 SQLCODE=-204,SQLSTATE=42704 - DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704 in connecting to db2 SQLCODE = -204,SQLSTATE = 42704仅在本地开发服务器上 - SQLCODE=-204, SQLSTATE=42704 only on local development server JPA DB2-删除表后获取SQLCODE“ -204”,SQLSTATE“ 42704”和SQLCODE = -727,SQLSTATE = 56098 - JPA DB2 - Getting SQLCODE “-204”, SQLSTATE “42704” and SQLCODE=-727, SQLSTATE=56098 after dropping table 文件系统已满.. SQLCODE=-968, SQLSTATE=57011, DRIVER=4.18.60 - The file system is full.. SQLCODE=-968, SQLSTATE=57011, DRIVER=4.18.60 在具有DB2并行进程的Java中:我出现了死锁异常:DB2 SQL错误:SQLCODE = -911,SQLSTATE = 40001,SQLERRMC = 2,DRIVER = 3.59.81 - In java with DB2 parallel process: I got Deadlock Exception :DB2 SQL Error: SQLCODE=-911, SQLSTATE=40001, SQLERRMC=2, DRIVER=3.59.81
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM