Search code examples
databaseforeign-keysprimary-keyhsqldb

Assign primary key in one DB as foreign key in other DB


A Primary Key column in table A in database One...I want assign it as foreign key in table B in database Two... both DB in same server, I'm using HSQLDB server 2.4 :

A- what would be the query?

B- I saw this way and I read it's not good practice,
Can we use join for two different database tables? two-different-database-tables

is there a better way ?


Solution

  • It is not possible with HSQLDB.

    You can do this with two different schemas in the same database.