If I have multiple sessions to different databases, is there a way to perform a join across them in one query?
For instance, I'm integrating two programs, with a table in the middle to translate id's from one to another. I'm currently just trying to run separate queries, building the next one using the data from the previous one. It seems to be getting a bit messy and I would like to do it in one query.
I haven't found anything that says this is possible, and knowing that the query is done on the session itself leads me to believe this might not be.
Thanks
if these are truly separate database servers, you'd need to use a system like dblink to establish a transparent proxy from one database to the other. Otherwise, if these databases are on the same server, there's usually some way to refer to tables in other schemas/databases, but it highly depends on the type of database in use.
But in any case, these routines would all involve being able to address all the databases on a single connection, which means in a single session. If you can't do it in one SQL statement, then you can't use a SQL JOIN, you'd need to collate data in memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With