[gdal-dev] How retrieve the list of field of a table on	spatialite in pythonlang.
    Even Rouault 
    even.rouault at mines-paris.org
       
    Thu Jul  3 11:59:14 PDT 2014
    
    
  
Le jeudi 03 juillet 2014 18:01:09, Andrea Peri a écrit :
> Hi,
> 
> I'm try-ing to retrieve the list of fieldname from a spatialite table.
> To do this I try this code:
> 
> dataset = "select * from table1"
> ds = driver.Open(file,False)
> layer = ds.ExecuteSQL(dataset,None,"SQLITE")
> layer.ResetReading()
> layerDef = layer.GetLayerDefn()
> .....
> 
> In the last line I'm having an error.
Andrea,
Which error ? I've just tried on a spatialite db and it works fine.
> 
> Is the comand "GetLayerDefn" available on sqlite driver ?
Yes, in all drivers. As soon as you have a non null layer object, you can call 
GetLayerDefn().
Even
-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
    
    
More information about the gdal-dev
mailing list