Project

General

Profile

Tareas #199

Updated by Jesús Freire almost 7 years ago

Take a list of COUSUA from ATCL table: 
 <pre> 
 SELECT * FROM ATCL WHERE CODATR IN ('COUSUA', 'CODAUT', 'AUULMO') CODATR='COUSUA' 
 </pre> 
 Prepare SQL script to alter column cousua of the tables extracted from the list of ATCL 
 <pre> 
 select concat('ALTER TABLE ', vaclob, ' ALTER COLUMN ', codatr, ' TYPE VARCHAR(45);') as sql from atcl where codatr in ('COUSUA', 'CODAUT', 'AUULMO') and coinob in (select coinob from objm where tiobme='CD' and coobme='OBJM') and subcla='CD' order by vaclob; 
 update atcl set longitud=45.00 where codatr in ('COUSUA', 'CODAUT', 'AUULMO') and coinob in (select coinob from objm where tiobme='CD' and coobme='OBJM') order by vaclob; 
 </pre> 

Back