Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-439

IDENTITY_VAL_LOCAL() returns null after INSERT INTO table VALUES(DEFAULT)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 10.0.2.1
    • 10.2.1.6
    • SQL
    • None
    • Mandriva 2005 Linux. Derby 10.0.2.1

    Description

      I have a table as follows
      CREATE TABLE MYTABLE
      (
      MYTABLE_ID BIGINT NOT NULL generated always as identity (start with 1)
      )
      and then I issue
      INSERT INTO MYTABLE VALUES (DEFAULT);
      followed by
      VALUES IDENTITY_VAL_LOCAL();
      This returns null!

      If instead my table was
      CREATE TABLE MYTABLE
      (
      MYTABLE_ID BIGINT NOT NULL generated always as identity (start with 1),
      NAME VARCHAR(20) NULL
      )
      and I then issue
      INSERT INTO MYTABLE ("NAME") VALUES ("NEW NAME");
      followed by
      VALUES IDENTITY_VAL_LOCAL();
      I get the value assigned to the identity column correctly.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andyj Andy Jefferson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: