1 Reply Latest reply: Aug 1, 2012 2:22 PM by Christian.Shay -Oracle RSS

    Entity Framework - Model First - Incorrect script

    953080
      I am trying to generate oracle script based on a model using Model-First approach as in the article:

      http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm
      I have selected:

      Database Generation Workflow property: Generate Oracle via T4(TPT).xaml
      DDL Generation Template: SSDLtoOracle.tt
      Here is the example of script that I am getting.

      -- Creating table 'Attachments'
      CREATE TABLE "CONF"."Attachments" (
      "AttachmentId" INT NOT NULL,
      "ClientId" INT NULL,
      "FileName" NVARCHAR(4000) NOT NULL,
      "Contents" VARBINARY(MAX) NOT NULL,
      "IsCurrent" BIT NOT NULL,
      "InsertDate" DATETIME NOT NULL,
      "InsertUser" VARCHAR(8000) NOT NULL,
      "DeleteDate" DATETIME NULL,
      "DeleteUser" VARCHAR(8000) NULL
      );

      The script contains not Oracle types.
      The generated script gives an exception because of incorrect type mapping for string, int and boolean.
        • 1. Re: Entity Framework - Model First - Incorrect script
          Christian.Shay -Oracle
          950077 wrote:
          I am trying to generate oracle script based on a model using Model-First approach as in the article:

          http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm
          I have selected:

          Database Generation Workflow property: Generate Oracle via T4(TPT).xaml
          DDL Generation Template: SSDLtoOracle.tt
          Here is the example of script that I am getting.

          -- Creating table 'Attachments'
          CREATE TABLE "CONF"."Attachments" (
          "AttachmentId" INT NOT NULL,
          "ClientId" INT NULL,
          "FileName" NVARCHAR(4000) NOT NULL,
          "Contents" VARBINARY(MAX) NOT NULL,
          "IsCurrent" BIT NOT NULL,
          "InsertDate" DATETIME NOT NULL,
          "InsertUser" VARCHAR(8000) NOT NULL,
          "DeleteDate" DATETIME NULL,
          "DeleteUser" VARCHAR(8000) NULL
          );

          The script contains not Oracle types.
          The generated script gives an exception because of incorrect type mapping for string, int and boolean.
          That is weird. It looks like our DDL Generation template is not being used at all. Can you please provide the first 10 lines or so of the script including comments if any?

          Also, you might try saving everything, closing Visual Studio and reopening it, checking to make sure the correct DDL template is still selected and then trying again.

          Also please provide the version of Visual Studio you are using (eg VS 2010)