Home Forums SQL Server 2008 SQL Server Newbies Oracle Linked Server - Error for invalid metadata for column that is not part of the Select Statement or Table Def RE: Oracle Linked Server - Error for invalid metadata for column that is not part of the Select Statement or Table Def

  • Think I found the reason and wanted to run this up the flagpole for others to comment. Am I on the right track?

    ESRI for Oracle, Shared Data:

    http://support.esri.com/em/knowledgebase/techarticles/detail/35658

    Cause : The Oracle parse error occurs because the shape.area or shape.len attribute is not fully qualified with its table name or a table alias in the SQL statement being executed in the database.

    Without fully qualifying the attribute, the shape.area or shape.len attributes are not valid attributes for the table being queried. The area and len attributes are properties of the st_geometry type and therefore must be fully qualified with the table alias when referenced within the SQL statement.

    Solution or Workaround

    The solution to the error is to fully qualify the shape.area or shape.len attribute in the definition queries 'where' clause.

    For example when adding a definition query for a layer named 'water_bodies' in ArcMap, an Oracle parse error with the following syntax is encountered:

    "NATION" = 52 AND "SHAPE.AREA" >= .000010

    By fully qualifying the attribute with the table name, no error is encountered.

    "NATION" = 52 AND "WATER_BODIES.SHAPE.AREA" >= .000010

    My further reading indicates that the SHAPE is an ESRI Oracle System file. My ODBC rights do not provide me with access to this. So, the Error as translated by ODBC is shown above.

    On this same SQL Server Linked Server to Oracle, I am able to read many views and tables that are pure data. These views and tables do not use the SHAPE to determine geograpical areas. Those tables and views named to indicate geopatial data filters have the same "SHAPE" error.