Other Software and Data

Expand all | Collapse all

MapXtreme 9.0 - Unable to parse statement : insert into error message

Jump to Best Answer
  • 1.  MapXtreme 9.0 - Unable to parse statement : insert into error message

    Posted 03-02-2020 10:17
    Hello,
    I am using MapXtreme 9.0.  I am selecting out of a layer (name is "MuniGrids") that has 6 columns (excluding Obj and MI_Style): 
        - Grid, COL2, COL3, COL4, COL5, & COL6
    I am defining my QueryDefinition to only select out COL1 (see code line below)
         - si.QueryDefinition.SetColumns("Obj,Grid,MI_Style".Split(","))
     
    The reason is because the layer I want to insert this feature collection into, named "ResultGrids", only has one column (excluding Obj and MI_Style).
         - GridName
    I run this code line successfully to build the iResultSetFeatureCollection
    GridFtrs = MapInfo.Engine.Session.Current.Catalog.Search("MuniGrids", si)
    No matter what I do, when I run this code line (below) to insert my GridFtrs MapXtreme throws an error:
    MapInfo.Engine.Session.Current.Catalog.InsertFeatures("ResultGrids")
    The error thrown is:  
    {"Unable to parse statement : insert into ""ResultGrids""(Grid) values(@0): "}
    {"Unable to parse statement : insert into ""ResultGrids""(Obj, Grid, MI_Style) values(@0, @1, @2): "}
    I get this same error message whether I change my query definition to just be the column I want, or if I try to make it purposefully selection out the "MI_Style" and "obj" fields (which are normally just hidden behind the scenes)
    Can anyone help out with what I am doing wrong?  I feel this is going to end up being an easy fix, but I just can't figure it out.
    Thanks in advance for any possible help


    ------------------------------
    Nicholas Evanish
    Senior Programmer Analyst
    ------------------------------


  • 2.  RE: MapXtreme 9.0 - Unable to parse statement : insert into error message
    Best Answer

    Posted 03-02-2020 13:57
    I resolved this issue.

    I had the column schema correct; however, I had one table I was inserting into with the wrong column name.  I assumed that MapXtreme would just use COL1 like MapInfo Pro does; however, I had to make sure the naming convention was exact.
    Now it works. 


    ------------------------------
    Nicholas Evanish
    Senior Programmer Analyst
    ------------------------------