db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mamta Satoor <msat...@gmail.com>
Subject Re: SQL Syntax : INSERT INTO when no columns to specify
Date Tue, 05 Jul 2005 17:27:44 GMT
I think this might be a bug in Derby where VALUES IDENTITY_VAL_LOCAL(); 
returns null even after single row insert with values clause into table with 
identity column. A Jira entry would be good to keep track of this.
 Mamta

 On 7/5/05, Andy Jefferson <lists@ajsoft.net> wrote: 
> 
> > If I'm understanding the question correctly, you should just use the
> > "DEFAULT" keyword to perform the insert:
> >
> > INSERT INTO tbl VALUES (DEFAULT)
> 
> Thanks Army.
> 
> That's certainly the sort of thing I'm looking for, *however*, if I do
> INSERT INTO tbl VALUES(DEFAULT);
> VALUES IDENTITY_VAL_LOCAL();
> 
> I get back null !
> 
> This goes against my interpretation of the documentation
> 
> http://incubator.apache.org/derby/docs/10.0/manuals/reference/sqlj82.html#HDRIDENTITYVALLOCAL
> since what I issues was a "single row INSERT statement", yet I get no 
> value
> back.
> 
> 
> If I change my table and add another column and then issue
> INSERT INTO tbl ("name") VALUES("new name")
> VALUES IDENTITY_VAL_LOCAL();
> I get back the value assigned to the identity column
> 
> 
> Is there a way I can do an INSERT AND access the value assigned by Derby ?
> 
> 
> --
> Andy
>

Mime
View raw message