DB2 ALTER Statement

DB2 CREATE Statement DB2 DROP Statement

Advertisements


ALTER can be used to add/delete/modify the DB2 Objects which already defined during the CREATE.

Primary and foreign key also can be defined by using ALTER once the table got created.

For performing ALTER, user required SYSADM or SYSCTRL authority and DBADM authority on DATABASE.

Syntax :

	ALTER TABLE table-name
	ADD column-name declaration;

Similarly the ALTER can be performed on DB2 objects like VIEWS, INDEXes, TABLE SPACES, DATABASES etc,.

Syntax :

	ALTER DB2-Object-name
	[Parameters newly added/modified]

Alter can be performed on the below list of Objects.

						
	ALTER ALIAS
	ALTER DATABASE
	ALTER FUNCTION
	ALTER INDEX
	ALTER PACKAGE
	ALTER PROCEDURE 
	ALTER ROLE
	ALTER SEQUENCE
	ALTER STOGROUP
	ALTER SYNONYM
	ALTER TABLE
	ALTER TABLESPACE
	ALTER TRIGGER
	ALTER TYPE
	ALTER VIEW


If any questions on the above, post your queries on DB2 Discussion forum


DB2 CREATE Statement DB2 DROP Statement

Advertisements