rem **************************************************
rem CAMBIAR COL. DIRE_CP_023 DE NUMBER(5) A VARCHAR2(5)
rem **************************************************

create table q0223t00_bak as select * from q0223t00
/
alter table Q0227T00 disable constraint FK_Q0223T00_01
/
delete q0223t00
/
commit
/
alter table q0223t00 modify (DIRE_CP_023 varchar2(5))
/
insert into q0223t00 select * from q0223t00_bak
/
drop table q0223t00_bak
/
commit
/
alter table Q0227T00 enable constraint FK_Q0223T00_01
/
update q0223T00 set DIRE_CP_023= CONCAT('0',DIRE_CP_023) where length(DIRE_CP_023)=4 and DIRE_CP_023 like '1%'
/
commit
/