db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: SQL Syntax : INSERT INTO when no columns to specify
Date Tue, 05 Jul 2005 17:53:06 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I filed DERBY-353 for BY DEFAULT identity issues. This seems slightly
different:<br>
<br>
Satheesh<br>
<br>
ij&gt; create table singleCol ( i int <b>generated always as identity</b>);<br>
0 rows inserted/updated/deleted<br>
ij&gt; INSERT INTO SingleCol VALUES(DEFAULT);<br>
1 row inserted/updated/deleted<br>
ij&gt; VALUES IDENTITY_VAL_LOCAL();<br>
1<br>
-------------------------------<br>
NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;=================== Wrong value here.<br>
1 row selected<br>
ij&gt; create table doubleCol(i int generated always as identity, j
int);<br>
0 rows inserted/updated/deleted<br>
ij&gt; insert into doubleCol(j) values 1;<br>
1 row inserted/updated/deleted<br>
ij&gt; VALUES IDENTITY_VAL_LOCAL();<br>
1<br>
-------------------------------<br>
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;==================== Correct value here.<br>
1 row selected<br>
Daniel John Debrunner wrote:
<blockquote cite="mid42CAC415.60808@debrunners.com" type="cite">
  <pre wrap="">Mamta Satoor wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Already there.

<a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/DERBY-353">http://issues.apache.org/jira/browse/DERBY-353</a>

Dan.



  </pre>
</blockquote>
</body>
</html>


Mime
View raw message