You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Andy Jefferson (JIRA)" <de...@db.apache.org> on 2005/07/05 19:42:30 UTC

[jira] Commented: (DERBY-439) IDENTITY_VAL_LOCAL() returns null after INSERT INTO table VALUES(DEFAULT)

    [ http://issues.apache.org/jira/browse/DERBY-439?page=comments#action_12315087 ] 

Andy Jefferson commented on DERBY-439:
--------------------------------------

Actually. After reading 353 further, it is only for GENERATED BY DEFAULT whereas my example above is "GENERATED ALWAYS" and is specifically the return of null in that case. No doubt someone who understands all of this can sort it out :-)

> IDENTITY_VAL_LOCAL() returns null after INSERT INTO table VALUES(DEFAULT)
> -------------------------------------------------------------------------
>
>          Key: DERBY-439
>          URL: http://issues.apache.org/jira/browse/DERBY-439
>      Project: Derby
>         Type: Bug
>     Versions: 10.0.2.1
>  Environment: Mandriva 2005 Linux. Derby 10.0.2.1
>     Reporter: Andy Jefferson

>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira