LucidDbImportForeignSchema

From Eigenpedia

Jump to: navigation, search

Syntax

IMPORT FOREIGN SCHEMA unqualified-schema-name
[ { LIMIT TO | EXCEPT } { ( unqualified-table-name, ... ) | TABLE_NAME LIKE string-literal } ]
FROM SERVER unqualified-server-name
INTO qualified-schema-name

Example

IMPORT FOREIGN SCHEMA sales
LIMIT TO TABLE_NAME LIKE '%2006'
FROM SERVER jdbc_link
INTO extraction_schema;

The import of a foreign schema is only a snapshot. New tables added subsequently in the foreign DBMS will not automatically become available in the local LucidDB catalog. To add new tables one can either re-import the entire schema or use the "LIMIT TO" option.

To re-import the entire schema you will need to drop the schema (with CASCADE) and then re-run the IMPORT FOREIGN SCHEMA; in this case, make sure there are no other dependent objects which will accidentally be dropped too by the CASCADE.

Be aware that for the JDBC foreign data wrapper, the import is affected by table_types used in the CREATE SERVER parameter.

Also see LucidDbCreateForeignServer.

Personal tools