Opened 6 years ago

Closed 6 years ago

#4134 closed defect (invalid)

ogr2ogr MySQL - -tables option appears not to work

Reported by: pvint Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version: 1.8.0
Severity: normal Keywords: ogr2ogr mysql tables
Cc:

Description

Perhaps I am not understanding this option properly, but as far as I can tell the -tables option like the following: ogr2ogr -overwrite -update -append -f MySQL MySQL:"spatialData,user=spatial,tables=testing" ../../canvec_030n13_shp/030n13_8_0_VE_1240009_2.shp should put the geometry data into the table called 'testing' and not create a unique table (in this case it creates one called 030n13_8_0_VE_1240009

From my trials (version 1.8.0) it appears that there is no difference in behaviour with or without the -tables= option (and no data appears in the 'testing' table, which I created by renaming a table that was auto-created). What I'm trying to do is import many shapefiles without creating a unique table for each, and rather have all the data in one table.

I've taken a quick look at the code, but would need LOTS more time to follow it through.

Thanks for any assistance, and for a really great product.

Paul

Change History (1)

comment:1 Changed 6 years ago by warmerdam

Component: defaultUtilities
Resolution: invalid
Status: newclosed

Paul,

The tables= item in the connection string is used to limit the list of tables initialized as layers through OGR when connecting to the database. This is mostly just helpful to avoid scanning detailed information for a lot of tables in large databases on startup.

It does not affect the name of tables created with ogr. I think you want to use the -nln switch to ogr2ogr to override the newly created table name.

eg.

ogr2ogr MYSQL:"..." canvec.shp -nln testing

Note: See TracTickets for help on using tickets.