Just for reminder that I've create this script. This script can be
utilize for mass update of a schema adding uniform column.
Here's the script:
That's just it!
utilize for mass update of a schema adding uniform column.
Here's the script:
/*
Script for mass adding multicompany column to all EPMS table
Author: MKR
Date: 26.09.2007 12:06
Assumption: Column Name = multi_org_id VARCHAR2(15)
*/
DECLARE
l_sql VARCHAR2(4000);
l_column_name VARCHAR2(100) := 'multi_org_id VARCHAR2(15)';
BEGIN
FOR i IN
( SELECT object_name FROM user_objects WHERE object_type='TABLE' )
LOOP
l_sql := 'ALTER TABLE ' || i.object_name || ' ADD ( ' || l_column_name ||' )';
BEGIN
EXECUTE IMMEDIATE l_sql;
EXCEPTION
WHEN Others THEN
Dbms_Output.Put_Line('Error: '|| SQLERRM);
END;
END LOOP;
END;
/
That's just it!
Comments