db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6843) Altering the Identity columns rules
Date Thu, 26 Nov 2015 20:16:10 GMT

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

Rick Hillegas commented on DERBY-6843:
--------------------------------------

Hi Anjana,

You could get part of the way to your goal by making the following alterations after loading
the table:

1) Add a CHECK NOT NULL constraint to the identity column. That will prevent someone from
inserting a tuple with no identity value.

2) You can add an UPDATE trigger which raises an error if someone tries to change the identity
value on an existing row.

Hope this helps,
-Rick

> Altering the Identity columns rules 
> ------------------------------------
>
>                 Key: DERBY-6843
>                 URL: https://issues.apache.org/jira/browse/DERBY-6843
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.11.1.1, 10.12.1.1
>         Environment: CENTOS
>            Reporter: Anjana
>
> We do export of from one derby database to another. Our database defined identity type
as ''GENERATED ALWAYS" Due to which the import does not consider the identity column value
from the export file. 
> Our requirement is to import those identity column values as well. 
> As per understanding one of the option in derby is to create table with identity type
as "GENERATED BY DEFAULT" . However need to understand if there is alternative in derby where
in we can modify the identity type before import to ''GENERATED by DEFAULT" and then after
import is successfully change it back to "GENERATED ALWAYS". 
> Appreciate if any one can guide on same. 



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

Mime
View raw message