[gdal-dev] RE [Polluriel potentiel] Re: ogr ODBC problem

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Thu May 31 09:11:10 PDT 2012


Thanks Brent for your answer.

But ....view's primary key?
I'm missing something here...What do you mean by that? Do you mean a 
column with a unique id in the view?
There is no such column in my view. 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.

Also, My problem is before using CONNECTIONTYPE OGR
    CONNECTION "<OGRVRTDataSource>

A simple ogrinfo like this
ODBC:username/password at WebMapDSN,v_MyPoints

Gives me the error OGR_ODBC: Table ?s???s!.????????? has no identified FID 
column. 

Thanks in advance
Steve






Brent Fraser <bfraser at geoanalytic.com> 
2012-05-31 10:49

A
Steve.Toutant at inspq.qc.ca
cc
gdal-dev at lists.osgeo.org
Objet
[Polluriel potentiel]  Re: [gdal-dev] ogr ODBC problem








Steve,

  Here's a snippet from a MapServer map file I used to access a 
non-spatial MS SQL server via OGR+VRT+ODBC:

    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "<OGRVRTDataSource>
        <OGRVRTLayer name='v_MyPoints'>
 
<SrcDataSource>ODBC:username/password at WebMapDSN,v_MyPoints</SrcDataSource>
           <SrcSQL>
            SELECT * FROM  v_MyPoints 
            WHERE  PropertyID=%PropertyID%
        </SrcSQL>
        <FID>PointID</FID>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding='PointFromColumns' y='SurfaceLatitude' 
x='SurfaceLongitude'/>
        <LayerSRS>NAD83</LayerSRS>
        </OGRVRTLayer>
    </OGRVRTDataSource>"

    PROCESSING "CLOSE_CONNECTION=DEFER"

    DATA "v_MyPoints"

In my case I was able to use the view's primary key as the FID.  Hope this 
helps...
Best Regards,
Brent Fraser

On 5/31/2012 7:48 AM, Steve.Toutant at inspq.qc.ca wrote: 

Thanks Jeff 
I got now OGR_ODBC: Table ?s???s!.????????? has no identified FID column. 

I found that several users had this problem but found no solution. I don't 
have write access to this MSSQL server. 

I'm connecting via ODBC to a non spatial table, but it contains latitude 
and longitude information. I will use it to define a OGRVRTDataSource and 
create geometry from point. 

Any clue on what I can do? 
thanks 
steve 




Jeff McKenna <jmckenna at gatewaygeomatics.com>@lists.osgeo.org 
Envoyé par : gdal-dev-bounces at lists.osgeo.org 
2012-05-30 17:06 


A
gdal-dev at lists.osgeo.org 
cc

Objet
Re: [gdal-dev] ogr ODBC problem










On 12-05-30 5:09 PM, Steve.Toutant at inspq.qc.ca wrote:
> 
> Hi!
> I use this command to get the tables from an ODBC connection
> ogrinfo ODBC:User/Pwd at DNS
> 
> The connection is succesful but I get this error several times
> ERROR 1: No column definitions found for table '?s???s!.???????????',
> layer not usable.
> 
> I used OGR ODBC for several months from a Windows server to a MSSQL 
server
> Now I'm migrating to linux and accessing the same MSSQL SERVER and I get
> this error.
> 
> Note that if I connect with isql, I can connect and query the database
> without problem.
> So the problem really seems to be with OGR
> 
> What can cause this No column definitions found for table error
> And why the table name looks like this  '?s???s!.???????????',

Hi Steve,

I was just debugging an ogrinfo command for MS4W/Oracle, and was
reminded of the trick to show more debug info at the commandline:

  set CPL_DEBUG=on

I'm going to keep that one in my back pocket from now on.

-jeff




-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev 




_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120531/3b97a519/attachment-0001.html>


More information about the gdal-dev mailing list