You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Vijender (JIRA)" <ji...@apache.org> on 2010/02/02 10:58:19 UTC

[jira] Created: (DERBY-4535) Data export/import issue

Data export/import issue
------------------------

                 Key: DERBY-4535
                 URL: https://issues.apache.org/jira/browse/DERBY-4535
             Project: Derby
          Issue Type: Bug
          Components: SQL
            Reporter: Vijender
            Priority: Critical


Hi,

I have created table as shown below.

CREATE TABLE ebics_order_type_gvo (
  uid                   INTEGER   NOT NULL   GENERATED ALWAYS AS IDENTITY ( START WITH 1, INCREMENT BY 1 )   PRIMARY KEY,
  gvo_code              VARCHAR(3)   NOT NULL   UNIQUE,
  gvo_desc              VARCHAR(80)
  );
And using below query to insert values.
INSERT INTO EBICS_ORDER_TYPE_GVO (UID,GVO_CODE,GVO_DESC) VALUES (100,'VIJ','desc');

Getting below error.
Error: java.sql.SQLException: Attempt to modify an identity column 'UID'. , SQL State: 42Z23, Error Code: -1

But if remove ( START WITH 1, INCREMENT BY 1 )  from the above table creation it is working file.
Can you pls help me how to import data without removing the above condition?

Thanks in advance.
Vijender.





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


[jira] Closed: (DERBY-4535) Data export/import issue

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-4535.
-------------------------------------

            Resolution: Invalid
    Bug behavior facts:   (was: [Data corruption])
      Issue & fix info:   (was: [High Value Fix])

Please ask questions about how to use Derby on derby-user@db.apache.org, and not in the bug tracker. Closing this bug report as invalid.

For the record, the answer to your question is that you should declare the UID column as GENERATED BY DEFAULT, not as GENERATED ALWAYS, if you intend to specify a value for that column on some occasions.

> Data export/import issue
> ------------------------
>
>                 Key: DERBY-4535
>                 URL: https://issues.apache.org/jira/browse/DERBY-4535
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Vijender
>            Priority: Critical
>
> Hi,
> I have created table as shown below.
> CREATE TABLE ebics_order_type_gvo (
>   uid                   INTEGER   NOT NULL   GENERATED ALWAYS AS IDENTITY ( START WITH 1, INCREMENT BY 1 )   PRIMARY KEY,
>   gvo_code              VARCHAR(3)   NOT NULL   UNIQUE,
>   gvo_desc              VARCHAR(80)
>   );
> And using below query to insert values.
> INSERT INTO EBICS_ORDER_TYPE_GVO (UID,GVO_CODE,GVO_DESC) VALUES (100,'VIJ','desc');
> Getting below error.
> Error: java.sql.SQLException: Attempt to modify an identity column 'UID'. , SQL State: 42Z23, Error Code: -1
> But if remove ( START WITH 1, INCREMENT BY 1 )  from the above table creation it is working file.
> Can you pls help me how to import data without removing the above condition?
> Thanks in advance.
> Vijender.

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