• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5493
  • Last Modified:

Alter Table in AS400

Hi.. I want to ask to You.
How syntac ALTER TABLE in DB2 (AS 400 Server / STRSQL)
My syntax is :

ALTER TABLE tristotr ADD COLUMN fieldtest DEC (18,2) NOT NULL WITH DEFAULT

that syntax is correct but IF I again INSERT FIELD IN TRISTOTR

   ALTER TABLE tristotr ADD COLUMN fieldtest2 DEC (18,2) NOT NULL
WITH DEFAULT

I get error  “SQL SYSTEM ERROR” , what's wrong ?



Regard
0
triary
Asked:
triary
1 Solution
 
shalomcCommented:
How do you try to alter the table? From a green screen? from Operations Navigator?
0
 
LowfatspreadCommented:
have you tried commiting the frst alteration?
0
 
triaryAuthor Commented:
To : Lowfatspread

Pls, give me sample syntax for alter table and commit .

because I get error 'Commit or Rollback not valid'
0
 
LowfatspreadCommented:
ALTER TABLE tristotr
ADD COLUMN fieldtest DEC (18,2) NOT NULL WITH DEFAULT
;
COMMIT
;
   ALTER TABLE tristotr
 ADD COLUMN fieldtest2 DEC (18,2) NOT NULL
WITH DEFAULT
;
COMMIT
;
0
 
Hafid MuhammadSkomCommented:
Thanks for share
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now