-
1. Re: Create a source model using a DDL
van.halbert Oct 31, 2014 8:58 AM (in response to bpiepers)Bas,
Can you paste in the contents of your DDL file?
I just imported an H2 ddl file from the quoickstarts. Example:
CREATE TABLE status
(
VDBName varchar(50) not null,
VDBVersion integer not null,
SchemaName varchar(50) not null,
Name varchar(256) not null,
TargetSchemaName varchar(50),
TargetName varchar(256) not null,
Valid boolean not null,
LoadState varchar(25) not null,
Cardinality long,
Updated timestamp not null,
LoadNumber long not null,
PRIMARY KEY (VDBName, VDBVersion, SchemaName, Name)
);
CREATE TABLE h2_stock_mat
(
product_id integer,
SYMBOL varchar(16),
PRICE decimal(20,4),
COMPANY_NAME varchar(256)
);
CREATE TABLE mat_stock_staging
(
product_id integer,
SYMBOL varchar(16),
PRICE decimal(20,4),
COMPANY_NAME varchar(256)
);
-
2. Re: Create a source model using a DDL
rareddy Oct 31, 2014 9:11 AM (in response to bpiepers)Also how are you importing? Use "Import DDL File" option, the DDL file should be simple text file. Then you need to select the dialect of the SQL you are importing.
-
3. Re: Create a source model using a DDL
blafond Oct 31, 2014 9:59 AM (in response to bpiepers)See the DDL import section the the Designer's User Guide: Chapter 5. Importers
-
4. Re: Create a source model using a DDL
bpiepers Oct 31, 2014 10:15 AM (in response to van.halbert)Hi all,
My simple example is from an SQL Server dialect and I think Teiid just doesn't support that:
CREATE TABLE BADGE_C (
ID varbinary(18) DEFAULT ((0)) NOT NULL,
CARDNO nvarchar(32) NOT NULL,
STAT_COD nchar(1) DEFAULT ('A'),
PRIMARY KEY (CARDNO,ID)
);
The quick start example from Van and the one Barry refers to give the same error message, by the way. However, if I use another very simple example like this one (very old, but okay) https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Developer_Studio/4.1/html-single/Teiid_Designer_User_Guide/i… it does work (so if I create a DDL with the contents of figure 3.3 in the manual of the link the import is successful but only if I manually choose dialect "Oracle"). Not sure yet why some simple examples work and why some don't...
I'm testing this on JDV 6 with Teiid Designer 8.3.3.
I am importing the way the documentation describes (see link from Barry).
-
5. Re: Create a source model using a DDL
blafond Oct 31, 2014 11:26 AM (in response to bpiepers)Teiid Designer utilizes Modeshape's DDL parsing framework and SQL Server DDL parsing (including unique datatypes like "varbinary" and "nvarchar") is not yet supported. I'd suggest logging a JIRA against ModeShape: ModeShape - JBoss Issue Tracker