db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <li...@ajsoft.net>
Subject Re: SQL Syntax : INSERT INTO when no columns to specify
Date Tue, 05 Jul 2005 16:59:14 GMT
> 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