After renaming the field with alter table the join now works.

On Oct 28, 2013, at 8:26 PM, William Kyngesburye wrote:

> I'm having a problem with with a join.  I suspect it has something to do with 
> the field names.
> 
> The shapefile DBF and the lookup DBF have a field name in SJIS: "土地利用種".  The 
> lookup table also has a field "class".  ogrinfo gives me the correct 
> SJIS->UTF8 conversion of the field name in the terminal.
> 
> ogr2ogr -sql 'SELECT b.class FROM "L03-b-09_5133" a LEFT JOIN 
> "/path/to/class.dbf".class b ON a."土地利用種" = b."土地利用種"' . L03-b-09_5133.shp
> 
> This just gives me a SQL syntax error.
> 
> I've successfully run other OGR SQL with the SJIS field, like casting it.  
> Maybe that's what I should do - cast it to rename it, then do the join (and 
> rename the lookup dbf field also)?
> 

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian]  What are you supposed to do WITH a maniacally depressed robot?

[Marvin]  You think you have problems?  What are you supposed to do if you ARE 
a maniacally depressed robot?  No, don't try and answer, I'm 50,000 times more 
intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy


_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to