[英]DSN8a10.emp is an undefined name
I just created a table named TELE by running the following query: 我通过运行以下查询刚刚创建了一个名为TELE的表:
CREATE TABLE TELE
(NAME2 VARCHAR(15) NOT NULL,
NAME1 VARCHAR(12) NOT NULL,
PHONE CHAR(4));
Now, I am trying to populate it with data from the DSN8A10.EMP table, by running the following query: 现在,我尝试通过运行以下查询,用DSN8A10.EMP表中的数据填充它:
INSERT INTO TELE
SELECT LASTNAME, FIRSTNME, PHONENO
FROM DSN8A10.EMP
WHERE WORKDEPT = 'D21';
But I get the following error: 但是我收到以下错误:
[42704][-204] "DSN8A10.EMP" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=4.23.42.
[42704] [-204]“ DSN8A10.EMP”是未定义的名称。SQLCODE= -204,SQLSTATE = 42704,DRIVER = 4.23.42。
I am using IntelliJ IDEA with com.ibm.db2.jcc.DB2Driver Data Server Driver. 我正在将IntelliJ IDEA与com.ibm.db2.jcc.DB2Driver数据服务器驱动程序一起使用。
Can you help me with a solution, please? 您能帮我解决一个问题吗? Thanks in advance!
提前致谢!
Some possibilities: 一些可能性:
the table does not exist because you have a typo in the schema name or the table name 该表不存在,因为您在模式名称或表名称中有错字
the table does exist but in a different database 该表确实存在,但是在另一个数据库中
the table exists in the database, but the name or schema has a MiXed case, in which case you must use double quotes around the schema name and table name. 该表已存在于数据库中,但名称或架构具有MiXed大小写,在这种情况下,您必须在架构名称和表名称周围使用双引号。 So "DSN8a10"."emp" is DIFFERENT from DSN8a10.EMP.
因此,“ DSN8a10”。“ emp”与DSN8a10.EMP不同。
If the Db2-server runs on Linux/Unix/Windows, this query may help to show a mixed case name. 如果Db2服务器在Linux / Unix / Windows上运行,此查询可能有助于显示大小写混合的名称。 It's possible the table is a view or alias or nickname.
该表可能是视图,别名或昵称。
select tabschema, tabname from syscat.tables where upper(tabschema)='DSN8A10' and upper(tabname) = 'EMP'
If the Db2-server runs on i-Series: use QSYS2.SYSTABLES instead. 如果Db2服务器在i系列上运行:请改用QSYS2.SYSTABLES。
select table_schema, table_name from qsys2.systables where upper(table_schema)='DSN8A10' and table_name='EMP'
If the Db2-server runs on Z/OS: use SYSIBM.SYSTABLES instead: 如果Db2服务器在Z / OS上运行,请使用SYSIBM.SYSTABLES代替:
select creator, name from sysibm.systables where upper(creator)='DSN8A10' and upper(name) = 'EMP'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.