Opened 20 years ago

Last modified 20 years ago

#463 closed defect (fixed)

[GDAL-ODBC]ogrinfo is not dumping features from flat text file database

Reported by: nsavard@… Owned by: warmerdam
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

ogrinfo is not dumping features from flat text file database using the unixodbc
ODBC text driver

I issued the "ogrinfo -al ODBC:NormTextDSN,capital" and only layer information
and column headers were displayed (see ogrinfo dump below).  The flat file
database is made of a three columns and a two rows table (see flat text
database: capital below).

I tested the connection with "isql NormTextDSN" and with the following SQL
statement:  "select * from capital".  The proper fields and field values were
displayed.  I joined the "odbc.ini" and "odbcinst.ini" configuration files below.

Expected result:  A complete dump of table field values for each feature.

-----------------
ogrinfo dump
-----------------
ogrinfo -al ODBC:NormTextDSN,capital
INFO: Open of `ODBC:NormTextDSN,capital'
using driver `ODBC' successful.
 
Layer name: capital
Geometry: Unknown (any)
Feature Count: 0
Layer SRS WKT:
(unknown)
X: String (255.0)
Y: String (255.0)
CapitalName: String (255.0)                                                    
     

-------------------------------
Flat text database table:  capital
-------------------------------
X,Y,CapitalName
12.57,58.99,New England


-------------------------------
odbc.ini
-------------------------------
[NormMyDSN]
Description             = myodbc3
Driver          = myodbc3
Server          = localhost
Database                = normodbc
Port            =
Socket          =
Option          = 3
Stmt            =
 
[NormTextDSN]
Description             = Text File
Driver          = Text File
Directory               = /home/nsavard/proj/ontariomnr/test/textdb
ReadOnly                = No
CaseSensitive           = Yes
Catalog         = No
ColumnSeperator         = ,                                                    
                                

--------------------------------------------------
odbcinst.ini
--------------------------------------------------
[Text File]
Description             = Simple text driver
Driver          = /usr/local/lib/libodbctxt.so
Setup           = /usr/local/lib/libodbctxtS.so
FileUsage               = 1
CPTimeout               =
CPReuse         =
 
[myodbc3]
Description             = MySQL ODBC driver
Driver          = /usr/local/lib/libmyodbc3.so
Setup           = /usr/local/lib/libodbcmyS.so
FileUsage               = 1
CPTimeout               =
CPReuse         =

Change History (1)

comment:1 by warmerdam, 20 years ago

It turns out the unixODBC text driver does not support SQLScrollFetch()
so I had to modify the CPLODBCStatement::Fetch() method to use 
SQLFetch() for cases that it is sufficient for.  

With this change things seem to work fine. 


Note: See TracTickets for help on using tickets.