BD2常用命令

上传人:碎****木 文档编号:235773034 上传时间:2022-01-06 格式:DOCX 页数:5 大小:79.59KB
返回 下载 相关 举报
BD2常用命令_第1页
第1页 / 共5页
BD2常用命令_第2页
第2页 / 共5页
BD2常用命令_第3页
第3页 / 共5页
亲,该文档总共5页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《BD2常用命令》由会员分享,可在线阅读,更多相关《BD2常用命令(5页珍藏版)》请在金锄头文库上搜索。

1、DB2的常用命令:1,列举出相应的 schema 下面的所有表。db2listtablesforschemaschemaname举例: db2listtablesforschemadb2admin2, 列举出当前数据库的目录。db2 list db directory举例:db2listdbdirectory3, DB2 自动增长主键方法generated always as identity(start with 1,increment by 1) 将一个字段指定为自增长型字段,放在数据类型后。举例:crate table students ( sno integer not null pr

2、imary key generated always as identity (start with 1, increment by 1), sname char(20), sname char(30)此时插入数据,然后查看结果,sno 自动增长 1.4, 数据的导入导出:export to E:name.txt of del select * from tableName导出举例 1:export to C:stInfo.ixf of ixf select * from students导出举例 2:导入举例 1:db2 import from E:name.txt of del insert into tableName导入举例 2:db2 import from E:name.ixf of ixf commitcount 5000 insert /create/replace intotableName5,查询表的主键:describe indexes for table .tablename show detail举例:

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 教育/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号