LINK TABLE
Links a table of another connection into the current H2 database
Arguments
connection (mandatory) the connection the table is read from, of any type; table name (mandatory). The current connection must be H2
Examples
LINKT mydb01 CUSTOMERS
Notes
Links a table of another configured connection into the current H2 database: LINK TABLE <connectionId> <tableName>.
The command runs H2's CREATE LINKED TABLE statement on the current connection, so the current connection must be an H2 database; on any other database the command is refused before anything is sent to it. The other connection, named by connectionId, is the data source the linked table reads: it can be any configured connection whose JDBC driver BroadSQL has (H2, HSQLDB, PostgreSQL, a driver added to the drivers folder...), because H2 reaches it through that driver.
Both arguments are mandatory. connectionId must be an existing, reachable connection (checked before linking). tableName is both the table read in the other database and the name the linked table gets in the current database; there is currently no way to link it under a different local name. The link is live: it does not copy the remote rows into the current database, every query on the linked table reads them from the other database.
H2 keeps the other connection's user and password in the linked table's definition, since it needs them to reach the data. BroadSQL never shows that password in its own messages.
Last modified in release 5.3.2.
BroadSQL