Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:18:05+00:00 2026-06-14T18:18:05+00:00

I have a database using Derby and am trying to execute an update statement

  • 0

I have a database using Derby and am trying to execute an update statement on a table that has a column with “GENERATED BY DEFAULT AS IDENTITY”. I am not trying to update this column, but all of the others.

I can’t seem to find the correct syntax to update the rest of the columns without getting errors such as “Attempt to modify an identity column”.

Trying to update the table I have been using the UPDATE command,

UPDATE TableName SET Name = '...', ..., WHERE Name = '...'

The first value within the table is an ID field that has the GENERATED BY DEFAULT AS IDENTITY design and I don’t want to update this value, I just want to update all of the other fields within the UPDATE command. I don’t know how to skip updating this value or simply update the ID field with itself.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:18:06+00:00Added an answer on June 14, 2026 at 6:18 pm

    So, here’s what I did; it worked fine. Can you identify what you are doing differently than this?

    ij> create table t1 (a int generated by default as identity, b int);
    0 rows inserted/updated/deleted
    ij> insert into t1 (b) values (1);
    1 row inserted/updated/deleted
    ij> update t1 set b=2 where b = 1;
    1 row inserted/updated/deleted
    ij> select * from t1;
    A          |B          
    -----------------------
    1          |2          
    1 row selected
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java app that has an embedded Derby database (no hibernate though).
I have (java) code that creates and populates tables in a derby database, using
I am using Derby database with Java and Eclipse. I have a table which
I am using a Derby database. I have a table like this: TB_ORDERS BUYER_NAME
I have a database table using an enum. This is already working with hibernate
I have created a MySQL database using MySQL Workbench. It has about 20 tables.
I am using embedded Apache Derby database for JUnit tests. I have some JPA
I have been developing a Java application using J2EE and a Derby database. My
I have created a JavaDB(Derby) database using Netbeans 7.1 on my mac and I
I have a database (using Microsoft SQL Server Management Studio Express) that is currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.