1 Reply Latest reply on Aug 17, 2005 3:25 PM by Frank Langelage

    CMP - default sysdate

    fss Newbie

      Hi,

      i have a cmp entity bean for one simple table tab_test (oracle9i).

      CREATE TABLE TAB_TEST(
       ID NUMBER NULL,
       INSERT_DATE DATE DEFAULT sysdate NOT NULL
      );
      
      ALTER TABLE TAB_TEST ADD (
       PRIMARY KEY (ID));
      


      The field insert_date has sysdate as default and could be autogenerated from the database. I tried to create a new entry, but I got the following error:


      13:19:22,698 INFO [STDOUT] javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-01400: cannot insert NULL into ("TEST"."TAB_TEST"."INSERT_DATE")


      I can only find articles about autogenerated primary keys! But the field Insert_date is not a primary key??

      Any suggestion?

      Thanx