<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Steve,<br>
    <br>
      In my case I was getting OGR to get data from a database view, but
    it could have been a table.  I think OGR needs (would like?) to know
    which column it can use for unque id.  I would expect your view (or
    table) would have a unique key column otherwise relation operations
    (like joins) can be a problem (the db admin should be able to tell
    you).<br>
    <br>
    Perhaps the ODBC system on Linux doesn't give OGR enough info about
    the columns to automatically identify the Primary Key column.  If
    you are testing with ogrinfo you could user the "-fid" option after
    you've identified the Primary Key column?<br>
    <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
    <br>
    On 5/31/2012 10:11 AM, <a class="moz-txt-link-abbreviated" href="mailto:Steve.Toutant@inspq.qc.ca">Steve.Toutant@inspq.qc.ca</a> wrote:
    <blockquote
cite="mid:OF78B1C004.3B035831-ON85257A0F.0057D5DE-85257A0F.0058EB91@isn.rtss.qc.ca"
      type="cite">
      <br>
      <font size="3">Thanks Brent for your answer.</font>
      <br>
      <br>
      <font size="3">But ....view's primary key</font><font
        face="sans-serif" size="2">?</font>
      <br>
      <font face="sans-serif" size="2">I'm missing something here...What
        do
        you mean by that? Do you mean a column with a unique id in the
        view?</font>
      <br>
      <font face="sans-serif" size="2">There is no such column in my
        view.
      </font><font size="3">Is ogr now needs a unique id in a view?
        Because it
        was working before I migrate to linux with a recent vertsion of
        gdal.</font>
      <br>
      <br>
      <font face="sans-serif" size="2">Also, My problem is before using
      </font><tt><font size="3">CONNECTIONTYPE
          OGR<br>
             CONNECTION "<OGRVRTDataSource></font></tt>
      <br>
      <br>
      <font face="sans-serif" size="2">A simple ogrinfo like this</font>
      <br>
      <tt><font size="3">ODBC:username/password@WebMapDSN,v_MyPoints</font></tt>
      <br>
      <br>
      <font face="sans-serif" size="2">Gives me the error OGR_ODBC:
        Table �s���s!.���������
        has no identified FID column.</font><font size="3"> </font>
      <br>
      <br>
      <font size="3">Thanks in advance</font>
      <br>
      <font face="sans-serif" size="2">Steve</font>
      <br>
      <br>
      <font face="sans-serif" size="2"><br>
      </font>
      <br>
      <br>
      <br>
      <table width="100%">
        <tbody>
          <tr valign="top">
            <td width="40%"><font face="sans-serif" size="1"><b>Brent
                  Fraser <a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com"><bfraser@geoanalytic.com></a></b>
              </font>
              <p><font face="sans-serif" size="1">2012-05-31 10:49</font>
              </p>
            </td>
            <td width="59%">
              <table width="100%">
                <tbody>
                  <tr valign="top">
                    <td>
                      <div align="right"><font face="sans-serif"
                          size="1">A</font></div>
                    </td>
                    <td><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:Steve.Toutant@inspq.qc.ca">Steve.Toutant@inspq.qc.ca</a></font>
                    </td>
                  </tr>
                  <tr valign="top">
                    <td>
                      <div align="right"><font face="sans-serif"
                          size="1">cc</font></div>
                    </td>
                    <td><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a></font>
                    </td>
                  </tr>
                  <tr valign="top">
                    <td>
                      <div align="right"><font face="sans-serif"
                          size="1">Objet</font></div>
                    </td>
                    <td><font face="sans-serif" size="1">[Polluriel
                        potentiel]  Re: [gdal-dev]
                        ogr ODBC problem</font></td>
                  </tr>
                </tbody>
              </table>
              <br>
              <table>
                <tbody>
                  <tr valign="top">
                    <td>
                      <br>
                    </td>
                    <td><br>
                    </td>
                  </tr>
                </tbody>
              </table>
              <br>
            </td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <br>
      <br>
      <br>
      <font size="3">Steve,<br>
        <br>
         Here's a snippet from a MapServer map file I used to access a
        non-spatial
        MS SQL server via OGR+VRT+ODBC:<br>
      </font><tt><font size="3"><br>
             TYPE POINT<br>
             CONNECTIONTYPE OGR<br>
             CONNECTION "<OGRVRTDataSource><br>
                 <OGRVRTLayer name='v_MyPoints'><br>
               
 <SrcDataSource>ODBC:username/password@WebMapDSN,v_MyPoints</SrcDataSource><br>
                    <SrcSQL><br>
                     SELECT * FROM  v_MyPoints
          <br>
                     WHERE  PropertyID=%PropertyID%<br>
                 </SrcSQL><br>
                 <b><FID>PointID</FID></b><br>
                 <GeometryType>wkbPoint</GeometryType><br>
                 <GeometryField encoding='PointFromColumns'
          y='SurfaceLatitude'  x='SurfaceLongitude'/><br>
                 <LayerSRS>NAD83</LayerSRS><br>
                 </OGRVRTLayer><br>
             </OGRVRTDataSource>"<br>
          <br>
             PROCESSING "CLOSE_CONNECTION=DEFER"<br>
          <br>
             DATA "v_MyPoints"</font></tt><font size="3"><br>
        <br>
        In my case I was able to use the view's primary key as the FID.
         Hope
        this helps...</font>
      <br>
      <tt><font size="3">Best Regards,<br>
          Brent Fraser</font></tt>
      <br>
      <font size="3"><br>
        On 5/31/2012 7:48 AM, </font><a moz-do-not-send="true"
        href="mailto:Steve.Toutant@inspq.qc.ca"><font color="blue"
          size="3"><u>Steve.Toutant@inspq.qc.ca</u></font></a><font
        size="3">
        wrote: </font>
      <br>
      <font face="sans-serif" size="2"><br>
        Thanks Jeff</font><font size="3"> </font><font
        face="sans-serif" size="2"><br>
        I got now OGR_ODBC: Table �s���s!.��������� has no identified
        FID column.</font><font size="3"> <br>
      </font><font face="sans-serif" size="2"><br>
        I found that several users had this problem but found no
        solution. I don't
        have write access to this MSSQL server.</font><font size="3"> <br>
      </font><font face="sans-serif" size="2"><br>
        I'm connecting via ODBC to a non spatial table, but it contains
        latitude
        and longitude information. I will use it to define a </font><font
        face="Times New Roman" size="3">OGRVRTDataSource</font><font
        face="sans-serif" size="2">
        and create geometry from point.</font><font size="3"> <br>
      </font><font face="sans-serif" size="2"><br>
        Any clue on what I can do?</font><font size="3"> </font><font
        face="sans-serif" size="2"><br>
        thanks</font><font size="3"> </font><font face="sans-serif"
        size="2"><br>
        steve</font><font size="3"> </font><font face="sans-serif"
        size="2"><br>
      </font>
      <p><font size="3"><br>
          <br>
        </font>
        <table width="100%">
          <tbody>
            <tr valign="top">
              <td width="67%"><font face="sans-serif" size="1"><b>Jeff
                    McKenna </b></font><a moz-do-not-send="true"
                  href="mailto:jmckenna@gatewaygeomatics.com"><font
                    color="blue" face="sans-serif" size="1"><b><u><jmckenna@gatewaygeomatics.com></u></b></font></a><font
                  face="sans-serif" size="1"><b>@lists.osgeo.org</b>
                  <br>
                  Envoyé par : </font><a moz-do-not-send="true"
                  href="mailto:gdal-dev-bounces@lists.osgeo.org"><font
                    color="blue" face="sans-serif" size="1"><u>gdal-dev-bounces@lists.osgeo.org</u></font></a><font
                  size="3">
                </font>
                <p><font face="sans-serif" size="1">2012-05-30 17:06</font><font
                    size="3">
                  </font>
                </p>
              </td>
              <td width="32%">
                <br>
                <table width="100%">
                  <tbody>
                    <tr valign="top">
                      <td width="14%">
                        <div align="right"><font face="sans-serif"
                            size="1">A</font></div>
                      </td>
                      <td width="85%"><a moz-do-not-send="true"
                          href="mailto:gdal-dev@lists.osgeo.org"><font
                            color="blue" face="sans-serif" size="1"><u>gdal-dev@lists.osgeo.org</u></font></a><font
                          size="3">
                        </font>
                      </td>
                    </tr>
                    <tr valign="top">
                      <td>
                        <div align="right"><font face="sans-serif"
                            size="1">cc</font></div>
                      </td>
                      <td>
                        <br>
                      </td>
                    </tr>
                    <tr valign="top">
                      <td>
                        <div align="right"><font face="sans-serif"
                            size="1">Objet</font></div>
                      </td>
                      <td><font face="sans-serif" size="1">Re:
                          [gdal-dev] ogr ODBC problem</font></td>
                    </tr>
                  </tbody>
                </table>
                <br>
                <br>
                <table width="100%">
                  <tbody>
                    <tr valign="top">
                      <td width="50%">
                        <br>
                      </td>
                      <td width="50%"><br>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <br>
              </td>
            </tr>
          </tbody>
        </table>
        <br>
        <font size="3"><br>
          <br>
          <br>
          <br>
        </font><tt><font size="2"><br>
            On 12-05-30 5:09 PM, </font></tt><a moz-do-not-send="true"
          href="mailto:Steve.Toutant@inspq.qc.ca"><tt><font color="blue"
              size="2"><u>Steve.Toutant@inspq.qc.ca</u></font></tt></a><tt><font
            size="2">
            wrote:<br>
            > <br>
            > Hi!<br>
            > I use this command to get the tables from an ODBC
            connection<br>
            > ogrinfo ODBC:User/Pwd@DNS<br>
            > <br>
            > The connection is succesful but I get this error
            several times<br>
            > ERROR 1: No column definitions found for table
            '�s���s!.�����������',<br>
            > layer not usable.<br>
            > <br>
            > I used OGR ODBC for several months from a Windows
            server to a MSSQL
            server<br>
            > Now I'm migrating to linux and accessing the same MSSQL
            SERVER and
            I get<br>
            > this error.<br>
            > <br>
            > Note that if I connect with isql, I can connect and
            query the database<br>
            > without problem.<br>
            > So the problem really seems to be with OGR<br>
            > <br>
            > What can cause this No column definitions found for
            table error<br>
            > And why the table name looks like this
             '�s���s!.�����������',<br>
            <br>
            Hi Steve,<br>
            <br>
            I was just debugging an ogrinfo command for MS4W/Oracle, and
            was<br>
            reminded of the trick to show more debug info at the
            commandline:<br>
            <br>
             set CPL_DEBUG=on<br>
            <br>
            I'm going to keep that one in my back pocket from now on.<br>
            <br>
            -jeff<br>
            <br>
            <br>
            <br>
            <br>
            -- <br>
            Jeff McKenna<br>
            MapServer Consulting and Training Services</font></tt><tt><font
            color="blue" size="2"><u><br>
            </u></font></tt><a moz-do-not-send="true"
          href="http://www.gatewaygeomatics.com/"><tt><font color="blue"
              size="2"><u>http://www.gatewaygeomatics.com/</u></font></tt></a><tt><font
            size="2"><br>
            <br>
            <br>
            _______________________________________________<br>
            gdal-dev mailing list</font></tt><tt><font color="blue"
            size="2"><u><br>
            </u></font></tt><a moz-do-not-send="true"
          href="mailto:gdal-dev@lists.osgeo.org"><tt><font color="blue"
              size="2"><u>gdal-dev@lists.osgeo.org</u></font></tt></a><tt><font
            color="blue" size="2"><u><br>
            </u></font></tt><a moz-do-not-send="true"
          href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><tt><font
              color="blue" size="2"><u>http://lists.osgeo.org/mailman/listinfo/gdal-dev</u></font></tt></a><font
          size="3">
          <br>
          <br>
          <br>
        </font>
      </p>
      <p>
        <br>
        <tt><font size="3">_______________________________________________<br>
            gdal-dev mailing list<br>
          </font></tt><a moz-do-not-send="true"
          href="mailto:gdal-dev@lists.osgeo.org"><tt><font color="blue"
              size="3"><u>gdal-dev@lists.osgeo.org</u></font></tt></a><tt><font
            size="3"><br>
          </font></tt><a moz-do-not-send="true"
          href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><tt><font
              color="blue" size="3"><u>http://lists.osgeo.org/mailman/listinfo/gdal-dev</u></font></tt></a>
        <br>
        <br>
        <br>
      </p>
    </blockquote>
  </body>
</html>