1

In SpatiaLite or Postgis, how can one create a SQL query to read a table from a MySql or Oracle database?

I don't know **the correct SQL syntax to connect to a table in a MySql or Oracle database **.

3
  • One database product is not generally able to connect directly to another database. You would typically using an application (like QGIS or ArcGIS, for example) with support for multiple database backends and use this as the point of integration. Commented Nov 25, 2015 at 0:52
  • What exactly are you trying to do? Commented Nov 25, 2015 at 4:40
  • Hi @DevdattaTengshe, in QGis I'm trying with a SQL query to create a join between a spatial feature presents in my SpatiaLite db with a table from a MySQL db. I would like to create a live connection with the table presents in MySQL with an SQL query but I don't know the corret syntax to call remote database (host, database, port, user, password). Commented Nov 25, 2015 at 5:13

1 Answer 1

1

You may be able to do this in PostGIS by using Foreign Data Wrappers (FDW). There is one for Oracle and another that can wrap any OGR datasource (which should include MySQL).

I've never tried this (why would I store data outside PostGIS?) but this blog post suggests it is quite easy to use.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.