Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When I try to import a shapefile using db2se, I specify the input columns to be loaded in the syntax as the 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.

But if I replace it with the POSITIONAL parameter, it works.

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.

Any reason why this would happen. The shapefile info is as below.

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]]"
share|improve this question
1  
May be because of case sensitivity? Try quoting the column name, something like ... -inputAttrColumns N(\"Cat_Zones\")... –  mustaccio Jun 6 at 19:29

1 Answer 1

up vote 1 down vote accepted

It was a case sensitivity issue. Using inputAttrColumns N(\"Cat_Zones\") solved the problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.