Unable to alter table - reason code is 10
-
18-02-2021 - |
質問
I'm trying to run this:
ALTER TABLE AMMLIBT.SAGRPPF ADD UNIQUE (ID) ADD CHECK ( IS_BUDGETABLE IN ( 0 , 1 )) ;
Which gives me this:
SQL State: 55019
Vendor Code: -7008
Message: [SQL7008] SAGRPPF in AMMLIBT not valid for operation. Cause . . . . . : The reason code is 10. Reason codes are:
[...]
10 -- A constraint or trigger is being added to an invalid type of table, or the maximum number of triggers has been reached, or all nodes of the distributed table are not at the same release level.
[...]
Recovery . . . : Do one of the following based on the reason code:
[...] 10 -- Specify tables that are valid for constraints or triggers.
[...]
...And I have no idea why and can't seem to find anything online explaining this.
The table is journalled and I've deleted all dependents.
I'm on IBM DB2 V7R1
How do I fix this?
解決
Thanks to Charles for pointing out this command: DSPFD AMMLIBT/SAGRPPF
Which showed me that:
Maximum members . . . . . . . . . . . . . . : MAXMBRS *NOMAX
To fix this, I needed to change '*NOMAX' to '1'. To do this, I went to my greenscreen and did:
- type
chgpf ammlibc/sagrppf
- F4
- F10
- Move cursor to 'Maximum members'
- Change '*NOMAX' to '1'
- Enter