Menu

Inserting problem with autoincrement column

Help
2006-07-27
2013-04-08
  • Olivier Duchęne

    Hello,

    First of all, thank you for this great library!

    I have a small problem. I'm using a hsqldb, and
    use a table with an autoincrement PK. I need to pass null for the PK for the autoincrement to be done on the DB side. In SQL, it looks like :

    insert into table values (null,"name"...)

    Pride enforces the use of a non null pk (or set it
    to 0 by default).

    How can I do that ?

    Thanks.

    Olivier

     
    • Olivier Duchęne

      OK, found the solution.
      I switch the type used for the PK, from int to Integer. Now, when inserting without setting
      the value for the PK, it defaults corectly to null.
      Thanks anyway.

      Olivier

       

Log in to post a comment.