简体   繁体   English

DSN8a10.emp是未定义的名称

[英]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.

相关问题 update manager_name基于emp_name,manager_id和emp_id - update manager_name based on emp_name,manager_id and emp_id Windows 7上的DSN如何解析主机名? - How does DSN on Windows 7 resolve the host name? 查询多个DSN(域名源) - Query regarding multiple DSN (domain source name) SQL - 要从 emp 表中找到最高和最低工资以及 emp 名称? - SQL - To find max and min salary from emp table along with emp name? 我有一个Oracle表EMP列是NAME,AGE,DEPT - i have a oracle table EMP columns are NAME,AGE,DEPT 需要在ODBC DSN连接的应用程序中标识数据库名称 - Need to Identify the Database name in an ODBC DSN connected application 连接到现有DSN时出现异常“找不到数据源名称” - Exception “Data source name not found” while connecting to an existing DSN 我有三个名称为emp,section,Type的表,现在我需要组合语句 - i have three tables with name emp, section,Type now i need the combination of statements 是否有任何方法可以找到数据库中具有特定值的列的所有表,例如。 EMP_NAME = ABC? - Is there any method to find all the table in database that has column with specific values eg. EMP_NAME = ABC? 显示名称,来自客户的最高工资,并使用联接显示该员工的订单 - display name,emp max salary from customers and also displaying orders of that employee using joins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM