当我尝试使用 db2se 导入 shapefile 时,我在语法中指定要加载的输入列作为 COLUMN NAME
db2se import_shape <dbname> -userId <username>
-pw <password> -fileName <shapefile to be loaded> -inputAttrColumns N(Cat_Zones) -srsName WGS84_SRS_1003 -tableSchema GEXPDBA -tableName TPOLYGON_STAGING -tableAttrColumns VC_FLD_1 -createTableFlag 0 -spatialColumn POLYGON_OB -typeSchema db2gse -typeName st_multipolygon -messagesFile C:\ABC1.txt -client 1
GSE2112N The column "CAT_ZONES" cannot be found in the dBASE file.
但是,如果我用 POSITIONAL 参数替换它,它就可以工作。
db2se import_shape <dbname> -userId <username>
-pw <password> -fileName <shapefile to be loaded> -inputAttrColumns P(1) -srsName WGS84_SRS_1003 -tableSchema GEXPDBA -tableName TPOLYGON_STAGING -tableAttrColumns VC_FLD_1 -createTableFlag 0 -spatialColumn POLYGON_OB -typeSchema db2gse -typeName st_multipolygon -messagesFile C:\ABC1.txt -client 1
GSE0000I The operation was completed successfully.
发生这种情况的任何原因。shapefile 信息如下。
db2se shape_info -filename <shapefile to be loaded>
Shape file information
----------------------
File code = 9994
File length (16-bit words) = 2533850
Shape file version = 1000
Shape type = 5 (ST_MULTIPOLYGON)
Number of records = 2636
Minimum X coordinate = -173.109762
Maximum X coordinate = -66.954002
Minimum Y coordinate = 18.915497
Maximum Y coordinate = 71.398048
Shapes do not have Z coordinates.
Shapes do not have M coordinates.
Shape index file (extension .shx) is present.
Attribute file information
--------------------------
dBase file code = 3
Date of last update = 2013-09-03
Number of records = 2636
Number of bytes in header = 97
Number of bytes in each record = 305
Number of columns = 2
Column Number Column Name Data Type Length Decimal
------------- --------------- -------------- ------ -------
1 Cat_Zones C ( Character) 254 0
2 Country C ( Character) 50 0
Coordinate system definition: "GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID
["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.01
74532925199433],METADATA["World",-180.0,-90.0,180.0,90.0,0.0,0.0174532925199433,
0.0,1262]]"
这是一个区分大小写的问题。使用
inputAttrColumns N(\"Cat_Zones\")
解决了问题。