db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2653) Expose existing auto-generated key functionality through more JDBC APIs in Derby Client.
Date Sat, 16 Feb 2008 20:21:08 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569608#action_12569608
] 

Kathey Marsden commented on DERBY-2653:
---------------------------------------

Actually  I was mistaken, with columnNames with JCC against DB2, it actually returns the insert
values for both columns whether they are identity columns or not.  For example for:
	s.executeUpdate(
	"create table t31_AutoGen (c31 int, " +
          "c32 int generated always as identity (increment by 1), " +
	"c33 int default 2)");
	String[] columnNames = {"C32","C31"};	
	PreparedStatement ps = conn.prepareStatement("insert into t31_AutoGen values(1,DEFAULT,DEFAULT)",columnNames);
	
	ps.executeUpdate();
	
	ResultSet rs = ps.getGeneratedKeys();

The ResultSet has 1 row with two columns, with values 1, 1.

I don't think that's right actually, but it doesn't support my argument that we ignore non-identity
columns.  It would be interesting to see how other databases behave.

Kathey






> Expose existing auto-generated key functionality through more JDBC APIs in Derby Client.
> ----------------------------------------------------------------------------------------
>
>                 Key: DERBY-2653
>                 URL: https://issues.apache.org/jira/browse/DERBY-2653
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>         Environment: Runnning with Derby Client.
>            Reporter: A B
>            Priority: Minor
>         Attachments: derby-2653_proto_diff.txt
>
>
> See DERBY-2631 for details.  Desired functionality is the same as for DERBY-2631, except
that this issue is specifically for Derby Client (DERBY-2631 only addressed embedded mode).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message