in reply to Re^2: how to use DBI connect to >1 database
in thread how to use DBI connect to >1 database

In some database engines you don't actually need to specify a database, since there's usually a default. But, if you did that you would need to specify fully qualified table names on every query, which would be annoying. Also, if you are a limited-access user sometimes the database wants you to choose so that it can make permission checks before allowing you to do anything.

For a real mind-bender, Postgres has a feature where it can import views of foreign databases from other servers (or even types of server, like mysql!) and then you can run a single query across multiple database servers! It's a bit awkward to set up, though.

  • Comment on Re^3: how to use DBI connect to >1 database