Domanda

How to query data from 2 or more databases with the same table structures. Have been research through internet but could not find any way to do this

The firebird we are using is 1.5 and no plan to upgrade to higher version for now.

I would like to do something like this which we normally do in oracle :

SELECT * 
FROM   tablea a 
       JOIN tableb@dblinktoanotherdb b 
         ON a.id = b.id 
WHERE  a.name = 'ABC' 

Can anyone help on this? Thank you.

È stato utile?

Soluzione

This is not supported by Firebird. So you have to do it at the client code - ie query the databases for data using different connections and combine resultsets into some memory dataset.

If you would upgrade to Firebird 2.5 you could use the EXECUTE STATEMENT ... ON EXTERNAL [DATA SOURCE] statement to do the work at server side, ie in an selectable stored procedure.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top