Possible Oracle SQL script generation bug - missing sequences
Posted: Thu 11 Jul 2013 09:57
Hello,
I am using EntityDeveloper 5.5.120 and DotConnect for Oracle. My approach is to create a model first entity database. Here is my Problem:
> The auto-increment (seqneces and triggers in oracle) statements are only generated for the first table that is using identity primary key generation <
When i add another table by copy and pasting the first one with exact the same attributes, the SQL squence and trigger statements for the identity column are missing. I cant figure out why nor do I know a proper woraround. Unfortunately this leads to unresovable problems:
The following SQL code will be generated and used for two identical classes (names Class1 and Class2) that both only have one attribute that is the auto increment primary identity key. As you can see the second CREATE SEQUENCE is missing:
Funny side notice: the sequence is beeing generated when deleting Class1 so it really sounds like a bug to me. I hope somebody can help me since I cant be the only one having this issue.
regards,
Will
I am using EntityDeveloper 5.5.120 and DotConnect for Oracle. My approach is to create a model first entity database. Here is my Problem:
> The auto-increment (seqneces and triggers in oracle) statements are only generated for the first table that is using identity primary key generation <
When i add another table by copy and pasting the first one with exact the same attributes, the SQL squence and trigger statements for the identity column are missing. I cant figure out why nor do I know a proper woraround. Unfortunately this leads to unresovable problems:
Code: Select all
ORA-01400: cannot insert NULL into ("WILL"."CLASS2"."PROPERTY2")
Code: Select all
--
-- Creating a table "will".CLASS2S
--
CREATE TABLE "will".CLASS2S (
PROPERTY2 NUMBER(10) NOT NULL,
CONSTRAINT PK_CLASS2S PRIMARY KEY (PROPERTY2)
);
--
-- Creating a table "will".CLASS1S
--
CREATE TABLE "will".CLASS1S (
PROPERTY1 NUMBER(10) NOT NULL,
CONSTRAINT PK_CLASS1S PRIMARY KEY (PROPERTY1)
);
--
-- Creating a sequence "will"."AI$CLASS1S_PROPERTY1_seq"
--
CREATE SEQUENCE "will"."AI$CLASS1S_PROPERTY1_seq" START WITH 1 INCREMENT BY 1;
--
-- Creating a trigger "will".AI$CLASS1S
--
CREATE OR REPLACE TRIGGER "will".AI$CLASS1S
BEFORE INSERT ON "will".CLASS1S
FOR EACH ROW
BEGIN
SELECT "will"."AI$CLASS1S_PROPERTY1_seq".NEXTVAL INTO :NEW.PROPERTY1 FROM DUAL;
END;
regards,
Will