将CASS导出的权利人名称导入城镇地籍数据库
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
将CASS导出的权利人名称导入城镇地籍数据库
说明:此文档是针对已经在城镇地籍软件中反填地籍调查表的数据库,在执行SQL语句之前要将数据库备份。
1、双击打开本地建立的地籍MDB数据库,在【表】页面下右键选择【导入】,如图:
(图2 MDB数据库中选择导入)
选择CASS导出的ZD_QLR表,导入的文件类型选成dbase5 (*.dbf)
(图3 选择导入的ZD_QLR)
●将新导入的文件重命名为zd_qlr_1。
(图4 在Access数据库中建立查询)●【选择关闭】
(图5 在Access数据库中建立查询)●建立【SQL视图】
(图6 建立SQL视图)
2、建立城镇地籍数据库中ZD_QLR中权利人名称与CASS导出的ZD_QLR中的权利人名
称的连接,是通过地籍号进行连接的,继续在SQL视图中执行以下语句(将原SQL视图中的内容清空,复制以下语句到视图中):
update (select a.qlrmc as mc1,b.qlrmc as mc2 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.qlrmc is not null ) c set c.mc1=c.mc2 执行方法同前,如图:
(图8 执行SQL语句,实现QLRMC的连接)
注:如果数据中从CASS中导出的ZD_QLR.dbf中没有地籍号(DJH),而存在权利人证件号(QLRZJH),可以省去第三步,在进行这一步的时候应只执行语句:
权利人名称
update (select a.qlrmc as mc1,b.qlrmc as mc2 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.qlrmc is not null ) c set c.mc1=c.mc2 代理人姓名
update (select a.dlrxm as mc1,b.dlrxm as mc2 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.dlrxm is not null ) c set c.mc1=c.mc2 土地证号
update (select a.tdzh as mc10,b.tdzh as mc20 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.tdzh is not null ) c set c.mc10=c.mc20 权利人证件类型
update (select a.qlrzjlx as mc13,b.qlrzjlx as mc23 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.qlrzjlx is not null ) c set c.mc13=c.mc23 代理人证件号
update (select a.dlrzjh as mc14,b.dlrzjh as mc24 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.dlrzjh is not null ) c set c.mc14=c.mc24 法人代表姓名
update (select a.frdbxm as mc15,b.frdbxm as mc25 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.frdbxm is not null ) c set c.mc15=c.mc25 法人代表证件类型
update (select a.frdbzjlx as mc16,b.frdbzjlx as mc26 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.frdbzjlx is not null ) c set c.mc16=c.mc26 权利人证件号
update (select a.qlrzjh as mc11,b.qlrzjh as mc22 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.qlrzjh is not null ) c set c.mc11=c.mc22 法人代表证件号
update (select a.frdbzjh as mc11,b.frdbzjh as mc22 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.frdbzjh is not null ) c set c.mc11=c.mc22 代理人电话号码
rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.dlrdhhm is not null ) c set c.mc11=c.mc22 法人代表电话号码
update (select a.frdbdhhm as mc11,b.frdbdhhm as mc22 from zd_qlr a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.frdbdhhm is not null ) c set c.mc11=c.mc22
3、数据导入完成,打开城镇地籍数据库的ZD_QLR表查看。如图,权利人名称已正确的导
入。
(图9 查看导入结果)
4、如果还需要更新宗地图层中的本宗指界人姓名(BZZJRXM),继续执行下列SQL语句:
方法同前。其中【ZD_K_230602】中的230602为数据库行政区代码的前六位,需要根据实际情况设定。
1、如果代理人姓名不为空空,指界人为代理人
update (select a.bzzjrxm as mc1,b.dlrxm as mc2 from ZD_K_232723 a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.dlrxm is not null ) c set c.mc1=c.mc2
2、如果代理人为空,指界人为法人代表
update (select a.bzzjrxm as mc1,b.frdbxm as mc2 from ZD_K_232723 a,zd_qlr_1 b where rtrim(ltrim(a.djh))=rtrim(ltrim(b.djh)) and b.dlrxm is null ) c set c.mc1=c.mc2
3、如果法人代表为空,指界人为权利人名称