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') </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; select concat('UPDATE ', vaclob, ' SET ', codatr, ' =''jfreire'' WHERE ', codatr, ' = ''FMJ000'';') 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; </pre> List of users: jfreire FMJ000 maria HPM000 antoniofreire FMA000