For a database (DB2 spatial is already enabled for it), I created a relation with the following attributes:

CREATE TABLE state.village (
    zipcode varchar(5),
    shape db2gse.st_multipolygon

And then wrote a script to load a shapefile, villages.shp, into the table as follows:

!db2se import_shape sample -fileName villages.shp -inputAttrColumns GEOID20 -srsName nad83_srs_1 -tableSchema state -tableName village -tableAttrColumns zipcode -createTableFlag 0 -spatialColumn shape -typeSchema db2gse -typeName st_multipolygon -messagesFile village.txt -client 1;

The shapefile has the following info:

Column Number  Column Name      Data Type       Length  Decimal
-------------  ---------------  --------------  ------  -------
            1  ZCTA5CE20        C ( Character)       5        0
            2  GEOID20          C ( Character)       5        0
            3  CLASSFP20        C ( Character)       2        0
            4  MTFCC20          C ( Character)       5        0
            5  FUNCSTAT20       C ( Character)       1        0
            6  ALAND20          N (   Numeric)      14        0
            7  AWATER20         N (   Numeric)      14        0
            8  INTPTLAT20       C ( Character)      11        0
            9  INTPTLON20       C ( Character)      12        0

However, each time I run this script, db2 -tvf script.sql, I always get this error:

GSE2108N  The method specification "G" to identify the attribute
columns to be imported from the file is not correct.

I have tried putting GEOID20 in quotes, making it lowercase and using N(GEOID20) but none worked.

db2level gives the following details:

DB21085I  This instance or install (instance name, where applicable: 
"db2inst1") uses "64" bits and DB2 code release "SQL11058" with level 
identifier "0609010F".
Informational tokens are "DB2 v11.5.8.0", "s2209201700", "DYN2209201700AMD64", 
and Fix Pack "0".

I don't quite know what's going wrong.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.