Entity Developer generating wrong script for SQLITE

Discussion of open issues, suggestions and bugs regarding EntityDAC
Post Reply
andrefm
Posts: 37
Joined: Wed 23 Oct 2013 10:02

Entity Developer generating wrong script for SQLITE

Post by andrefm » Wed 12 Feb 2014 06:41

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

andrefm
Posts: 37
Joined: Wed 23 Oct 2013 10:02

Re: Entity Developer generating wrong script for SQLITE

Post by andrefm » Wed 12 Feb 2014 07:42

Please ignore my post. I edited the EntityProperties and changed the Data Type and now I was able to create the tables.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Entity Developer generating wrong script for SQLITE

Post by AlexP » Wed 12 Feb 2014 11:14

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.

andrefm
Posts: 37
Joined: Wed 23 Oct 2013 10:02

Re: Entity Developer generating wrong script for SQLITE

Post by andrefm » Thu 13 Feb 2014 08:36

Thx Alex. Works great with your tip. Entity Developer is really good :)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Entity Developer generating wrong script for SQLITE

Post by AlexP » Thu 13 Feb 2014 13:20

Glad to see that the issue was resolved. If you have any further questions, feel free to contact us.

Post Reply