博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【DB2】DB2使用IMPORT命令导入含有自增长列的表报错处理
阅读量:6956 次
发布时间:2019-06-27

本文共 772 字,大约阅读时间需要 2 分钟。

1.启动数据库:db2start

2.创建数据库:create db TestDB using codeset gbk territory CN  collate using identity

3.连接数据库:connect to TestDB user db2inst1 using db2inst1

4.创建表:create table TestTB(id integer not null generated always as identity(start with 1,increment by 1),name varchar(10))

5.数据文件如下:

5.1首先插入数据:

INSERT INTO TestTB(name) VALUES('zhangsan')INSERT INTO TestTB(name) VALUES('lisi')

5.2 导出数据

export to /home/oliver/TestTB.ixf of ixf select * from db2inst1.TestTB

5.3删除数据

delete from db2inst1.TestTB

5.4 导入已经导出数据

import from /home/oliver/TestTB.ixf of ixf insert into db2inst1.TestTB

结果报错了:

这就是由于表中存在自增字段导致错误,那么如何解决呢?

import from /home/oliver/TestTB.ixf of ixf modified by identityignore replace into  db2inst1.TestTB

identityignore 忽略自增identitymissing 自动生成自增identityoverride 使用自增

转载地址:http://invil.baihongyu.com/

你可能感兴趣的文章
HTML5新增核心工具——canvas
查看>>
改动file header (測)
查看>>
微软职位内部推荐-Senior Speech TTS
查看>>
UVA - 10574 Counting Rectangles
查看>>
HDU3336-Count the string(KMP)
查看>>
常用API接口签名验证参考
查看>>
Linux中find常见用法示例
查看>>
bootstrap 模态框动态加载数据
查看>>
初始化构造函数中定义的实体集合,方便嵌套类型的遍历
查看>>
深入理解css3中nth-child和 nth-of-type的区别
查看>>
MySQL慢查询Explain Plan分析
查看>>
MyBatis原理分析之三:初始化(配置文件读取和解析)
查看>>
180321
查看>>
Spark2.1.0之源码分析——事件总线
查看>>
Htmlparser专题
查看>>
大数据开发实战:数据平台大图和离线数据平台整体架构
查看>>
Spring MVC 3 深入总结
查看>>
Android自定义控件View(一)
查看>>
C/C++中的getline函数总结:
查看>>
【转】雪崩光电二极管(APD)偏置电源及其电流监测
查看>>