Access remote tables
A remote table is a table on a database server other than the current server. You can connect from your current server to a remote server.
At any time, there can be only one active connection from the local server to a remote server. HCL OneDB™ does not support multiple active connections between the same two database servers using different server aliases. Thus, if you use different server aliases to connect to the same remote server, the initial connection is reused.
database@server:[owner.]table
Here, a table can be a table name, view name or synonym. You have the option of specifying the table owner. For the complete syntax options, see the documentation of the Database and Database Object segments in the HCL OneDB Guide to SQL: Syntax.
DATABASE locdb; SELECT l.name, r.assignment FROM rdb@rsys:rtab r,
loctab l WHERE l.empid = r.empid;
This query accesses the name and empid columns from the local table loctab, and the assignment and empid columns from the remote table rtab. The data is joined using empid as the join column.
DATABASE locdb; INSERT INTO loctab SELECT * FROM rdb@rsys:rtab;
This query selects all data from the remote table rtab, and inserts it into the local table loctab.
DATABASE locdb; CREATE VIEW myview (empid, empprty)
AS SELECT empid, priority FROM rdb@rsys:rtab;