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

ASF subversion and git services commented on DERBY-6753:
--------------------------------------------------------

Commit 1628596 from [~mamtas] in branch 'code/trunk'
[ https://svn.apache.org/r1628596 ]

DERBY-6742(For update statement, collect generated keys if 
Statement.RETURN_GENERATED_KEYS flag is supplied to the JDBC call.)

This commit now allows JDBC statement to receive a resultset for auto generated 
keys for an UPDATE statement updating the generated values with DEFAULT clause. 
Such a resultset will be generated only if the UPDATE statement updated a 
single row and there were generated columns involved in the update. This 
functionality already exists for INSERT statement. It is currently implemented 
for INSERT statement by calling VALUES IDENTITY_VAL_LOCAL() from 
EmbedStatement.getGeneratedKeys(). I have used this existing mechanism to 
collect generated values resultset for UPDATE too. This means that the scope of 
IDENTITY_VAL_LOCAL() function has grown from INSERT statement to also include 
UPDATE statement. This will require us to update the documentation for 
IDENTITY_VAL_LOCAL(). I have created DERBY-6753(Docs for IDENTITY_VAL_LOCAL 
needs to be updated to indicate that the return value will be impacted by 
single row UPDATE of identity column) for the documentation task.

> Docs for IDENTITY_VAL_LOCAL needs to be updated to indicate that the return 
> value will be impacted by single row UPDATE of identity column
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6753
>                 URL: https://issues.apache.org/jira/browse/DERBY-6753
>             Project: Derby
>          Issue Type: Task
>          Components: Documentation
>    Affects Versions: 10.12.0.0
>         Environment: Changes for DERBY-6742 will now make the newly generated 
> value for a single row UPDATE statement available through 
> IDENTITY_VAL_LOCAL(). Current documentation mentions only INSERT statement 
> changing the value of IDENTITY_VAL_LOCAL(). The changes in the doc are very 
> localized and from my search, the changes need to go only in the reference 
> manual. 
> Basically, DERBY-6414 now allows an identity column's value to be updated 
> using DEFAULT clause in UPDATE statement(prior to DERBY-6414, there was no 
> way of updating an identity column). This updated value is available through 
> IDENTITY_VAL_LOCAL if only one row was updated of a table with identity 
> column AND identity column was updated as part of that UPDATE with DEFAULT 
> clause. The rules for UPDATE are same as for INSERT for IDENTITY_VAL_LOCAL. 
> The rules for INSERT are already documented in the reference manual.
>            Reporter: Mamta A. Satoor
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to