追加查询&密钥违规错误 [英] Append Query & Key Violations Error

查看:102
本文介绍了追加查询&密钥违规错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个问题是从访问中将数据附加到oracle表中。我将excel表中的新数据导入到访问中的表中,并使用追加查询将数据添加到链接的oracle表中。链接表具有复合主键(Code,Org)。访问中的表具有不在oracle表中的新数据,并且PK字段中的数据不会重复。我还确保两个表都有相同的数据类型。


我创建了一个追加查询,它将导入表中的记录添加到链接表中。追加查询在链接表的副本上成功完成,但是当我在链接表上尝试时,我不断收到密钥冲突错误。它表示由于密钥违规,访问没有将932(所有记录)记录添加到表中。该表有很多字段,但我只想在下面的查询中添加字段。


这是我的查询:

Hi

I have a problem appending data into an oracle table from access. I imported the new data from an excel sheet into a table in access and useed an append query to add the data into a linked oracle table. The linked table has a composit primary key (Code, Org). The table in access has new data that are not in the oracle table and the data in the PK fields are not duplicated. I also made sure that both tables have same data types.

I created an append query that adds the records from the imported table into the linked one. The append query is done successfully on a copy of the linked table, however I keep getting the Key Violation error when I try it on the linked table. It says that access didn''t add 932 (All records) record(s) to the table due to key violations. The table has lots of fields but I want to add only the fields in the query below.

Here is my query:

展开 | 选择 | Wrap | 行号

推荐答案

您好,MeeMee。


您的查询将返回[R5OBJECTS]的所有记录,包括那些已经存在的记录目录在[D7ITEST_R5OBJECTS]。

你错过了WHERE子句
Hello, MeeMee.

Your query is expected to return all records from [R5OBJECTS] including those already present in [D7ITEST_R5OBJECTS].
You''ve missed WHERE clause
展开 | 选择 | Wrap | 行号



你好,MeeMee。


您的查询将返回[R5OBJECTS]中的所有记录,包括[D7ITEST_R5OBJECTS]中已有的记录。

您错过了WHERE子句
Hello, MeeMee.

Your query is expected to return all records from [R5OBJECTS] including those already present in [D7ITEST_R5OBJECTS].
You''ve missed WHERE clause
展开 | 选择 | Wrap | 行号


表中是否还有其他约束(但是主键)? />
或者可能是触发器?
Do you have any other constraint (but primary key) in the table?
Or maybe triggers?


这篇关于追加查询&密钥违规错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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