Page 1 of 1

Entity Developer generating wrong script for SQLITE

Posted: Wed 12 Feb 2014 06:41
by andrefm
Hi,
I just downloaded EntityDAC and before connecting to any database I thought in creating a SQLite database as it's simpler than any other database for tests.
I opened via Entity Developer the EntityDemo and chose to Update Database from Model. Before that I created the connection to SQLite (creating a new file), but when executing the wizard I'm getting error "SQLite Error near "CHAR": syntax error" when executing the script generated to create the tables.
If I'm not wrong the script generated is wrong because there should be no CHAR after the field size.

Code: Select all

-- Script was generated by Devart Entity Developer, Version 5.7.290.0
-- Script date 12/02/2014 17:33:26
-- Target Server: SQLite
-- Server Version: 3.7

-- 
-- Creating a table "main".DEPT 
-- 
CREATE TABLE "main".DEPT (
   DEPTNO INTEGER PRIMARY KEY AUTOINCREMENT,
   DNAME VARCHAR2(14 CHAR),
   LOC VARCHAR2(13 CHAR)
);
...
Thx

Re: Entity Developer generating wrong script for SQLITE

Posted: Wed 12 Feb 2014 07:42
by andrefm
Please ignore my post. I edited the EntityProperties and changed the Data Type and now I was able to create the tables.

Re: Entity Developer generating wrong script for SQLITE

Posted: Wed 12 Feb 2014 11:14
by AlexP
Hello,

The Demo model was created for the Oracle database, therefore Oracle types are specified in the model. To generate correct scripts for other databases, you can either specify explicitly the required type in the Server Data Type property or select the Regenerate Storage option in the Update Database (Generate DataBase Script) wizard when generating scripts - in this case, the types of the selected database will be used, but not the ones specified in the Server Data Type property.

Re: Entity Developer generating wrong script for SQLITE

Posted: Thu 13 Feb 2014 08:36
by andrefm
Thx Alex. Works great with your tip. Entity Developer is really good :)

Re: Entity Developer generating wrong script for SQLITE

Posted: Thu 13 Feb 2014 13:20
by AlexP
Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.