[
https://issues.jboss.org/browse/TEIID-4760?page=com.atlassian.jira.plugin...
]
Bram Gadeyne commented on TEIID-4760:
-------------------------------------
[~shawkins],
I've tested this on 10.3.1 but it does not seem to work.
For the izisprod schema my import statements look like this.
{code:sql}
SET SCHEMA izisprod;
IMPORT FOREIGN SCHEMA dbo FROM SERVER izisprod INTO izisprod
OPTIONS(
importer.catalog 'master',
importer.schemaPattern 'dbo',
importer.importKeys false,
importer.importStatistics false,
importer.tableNamePattern 'syslogins',
importer.useFullSchemaName false,
importer.tableTypes 'SYSTEM TABLE',
importer.nameFormat 'prod_%s'
);
IMPORT FOREIGN SCHEMA dbo FROM SERVER izisprod INTO izisprod
OPTIONS(
importer.catalog 'master',
importer.schemaPattern 'dbo',
importer.importKeys false,
importer.importStatistics false,
importer.tableNamePattern 'sysprocesses',
importer.useFullSchemaName false,
importer.tableTypes 'SYSTEM TABLE',
importer.nameFormat 'prod_%s'
);
IMPORT FOREIGN SCHEMA dbo FROM SERVER izisprod INTO izisprod
OPTIONS(
importer.catalog 'Patient',
importer.schemaPattern 'dbo',
importer.importKeys false,
importer.importStatistics false,
importer.useFullSchemaName false,
importer.tableTypes 'TABLE,VIEW',
importer.nameFormat 'prod_%s'
);
IMPORT FOREIGN SCHEMA dbo FROM SERVER izisprod INTO izisprod
OPTIONS(
importer.catalog 'System',
importer.schemaPattern 'dbo',
importer.importKeys false,
importer.importStatistics false,
importer.useFullSchemaName false,
importer.excludeTables '.*U_PV_PatientLocation.*',
importer.tableTypes 'TABLE,VIEW',
importer.nameFormat 'prod_%s'
);
IMPORT FOREIGN SCHEMA dbo FROM SERVER izisprod INTO izisprod
OPTIONS(
importer.catalog 'Department',
importer.schemaPattern 'dbo',
importer.importKeys false,
importer.importStatistics false,
importer.useFullSchemaName false,
importer.excludeTables '.*sysquerymetrics.*',
importer.tableTypes 'TABLE,VIEW',
importer.nameFormat 'prod_%s'
);
{code}
In the resulting schema the table and view names don't have a prefix
"prod_".
optional object name manipulations while executing IMPORT FOREIGN
SCHEMA
------------------------------------------------------------------------
Key: TEIID-4760
URL:
https://issues.jboss.org/browse/TEIID-4760
Project: Teiid
Issue Type: Feature Request
Components: Misc. Connectors
Reporter: Bram Gadeyne
Assignee: Steven Hawkins
Labels: ddl, import, import_wizard
Fix For: 10.3
While executing IMPORT FOREIGN SCHEMA, table (and other object) names are added to the
schema with their original names.
In our previous virtual database we imported two schema's that contain the same
objects but one is a production and another is a historical database.
We then change the name for e.g. table1 to prod_table1 or wh_table1 according to the
schema it came from. Some software that interacts with teiid can not distinguish between
different schemas and can not handle duplicate table names. So for this reason, this would
also come in handy.
It would come in handy if it is possible to add a prefix to names while importing
objects.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)