Solved

Alter Table in AS400

Posted on 2004-04-23
5
5,033 Views
Last Modified: 2016-11-01
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
Comment
Question by:triary
5 Comments
 
LVL 33

Expert Comment

by:shalomc
ID: 10908272
How do you try to alter the table? From a green screen? from Operations Navigator?
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 10911663
have you tried commiting the frst alteration?
0
 

Author Comment

by:triary
ID: 10915261
To : Lowfatspread

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

because I get error 'Commit or Rollback not valid'
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 50 total points
ID: 10920721
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
 

Expert Comment

by:Hafid Muhammad
ID: 41869471
Thanks for share
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now