DECLARE v_sql VARCHAR2(200); v_table VARCHAR2(30); v_clums NUMBER; CURSOR C1 IS SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE 'UE_GW_%'; BEGIN OPEN C1; LOOP FETCH C1 INTO v_table; select count(column_name) INTO v_clums from user_tab_columns where table_name= v_table AND COLUMN_NAME = 'HZZSY'; IF v_clums = 0 THEN v_sql:='ALTER TABLE '||v_table||' ADD HZZSY VARCHAR2(50)'; EXECUTE IMMEDIATE v_sql; END IF; END LOOP; CLOSE C1; END;