ALTER TABLE customer_info ALTER COLUMN customer_age SET DATA TYPE datatype;
Examples:
create table pippo(idpippo decimal(18) not null, cdesc char(20));
alter table pippo add primary key (idpippo);
insert into pippo values (2,’ciaooo’);
ALTER TABLE pippo ALTER COLUMN cdesc SET DATA TYPE varchar(50);
ALTER TABLE pippo ALTER COLUMN cdesc SET DATA TYPE varchar(60);
You can not go back to CHAR.
ALTER TABLE pippo ALTER COLUMN cdesc SET DATA TYPE char(40);
KO: Reason code=”23?.. SQLCODE=-20054, SQLSTATE=55019
ALTER TABLE pippo ALTER COLUMN idpippo SET DATA TYPE decimal(28);
ALTER TABLE pippo ALTER COLUMN idpippo SET DATA TYPE decimal(3);
In most cases, ALTER SET DATA TYPE requires table reorganization (reorg statement) because it changes the physical row format.
Really Nice Information,Thank You Very Much For Sharing.
ReplyDeleteWordpress Development Company