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

  • Home
  • SEARCH
  • 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 1029483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:33:03+00:00 2026-05-16T12:33:03+00:00

I have a table on a iSeries(IBM-i/AS400) which has some constraints. The table is

  • 0

I have a table on a iSeries(IBM-i/AS400) which has some constraints. The table is created with SQL like so, with a handful of foreign keys linking from other tables to this table (actual SQL has been a bit obfuscated here):

CREATE TABLE ABCLIB.ABCDE (
  DEIDN INTEGER NOT NULL WITH DEFAULT, 
  DETTL VARGRAPHIC (50) ALLOCATE(25), 
  DETYP CHAR (1) NOT NULL WITH DEFAULT);

ALTER TABLE ABCLIB.ABCDE ADD PRIMARY KEY (DEIDN);

ALTER TABLE ABCLIB.ABCFG ADD FOREIGN KEY (FGDEK) 
  REFERENCES ABCLIB.ABCDE (DEIDN) 
  ON DELETE RESTRICT ON UPDATE RESTRICT;

ALTER TABLE ABCLIB.ABCHI ADD FOREIGN KEY (HIDEK) 
  REFERENCES ABCLIB.ABCDE (DEIDN) 
  ON DELETE RESTRICT ON UPDATE RESTRICT;

Now, much later, I will need to alter that table to add a field:

ALTER TABLE ABCLIB.ABCDE ADD COLUMN DEICN VARGRAPHIC (100) ALLOCATE(50)     

Which results in this message:

Row or object ABCDE in ABCLIB type *FILE in use.

I have checked and there are definitely no object locks on this table at this time. When I check the joblog, I see this:

Constraint cannot be removed from file Q_AT000000.    
Constraint(s) not removed from file Q_AT000000.       
File ABCDE in ABCLIB not changed.                 
Row or object ABCDE in ABCLIB type *FILE in use.  

Now, I could of course remove and re-add the constraints in question, but I feel like this should not be necessary. The column I am adding has nothing to do with the constraints. I believe this probably is a result of the fact that in fact OS400 (i5/OS) is not really altering the existing table but instead is creating a new table and copying data in, and that is probably where the pain comes in.

But is there a way to possibly suspend the keys and then resume them after the alter?

(Answers that do not involve doing this with SQL or suggest creating the table differently in the first place are not helpful as they are not applicable here…)

  • 1 1 Answer
  • 4 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-05-16T12:33:04+00:00Added an answer on May 16, 2026 at 12:33 pm

    The answer is: I missed the fact that there was a lock on one of the tables that had a foreign key pointing to that table. Or, put more bluntly: I am an idiot!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table in my database which has fields of ID,NAME,CONTEXT. I am showing
I have table named as contacts which has nearly 1.2 million records we use
I have table in which I am inserting rows for employee but next time
I have table and this table contain result column with some entries. I just
We are connecting to a multi-member AS400 iSeries table via HIT OLEDB and HIT
IBM only provides a database connection to the iSeries, thus I have to work
I have table in an MS Access database that looks like this: ID Symbol
I have table the following data structure in SQL Server: ID Date Allocation 1,
I have table view which is populated from an array grabbed from a url.
I have table like below ID User Date Location 1 Tom 6-Mar-2012 US 2

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.