alter system set nls_length_semantics='CHAR' scope=both; begin for i in (select ('ALTER TABLE '|| C.owner || '.' || C.table_name|| ' modify (' || C.column_name || ' '|| C.data_type || '(' || C.char_length|| ' CHAR))') as Q from all_tab_columns C, all_tables T where C.owner = T.owner and C.table_name = T.table_name and C.char_used = 'B' and C.table_name not in (select table_name from all_external_tables) and C.data_type in ('VARCHAR2', 'CHAR') ) LOOP BEGIN execute immediate i."Q"||' '; EXCEPTION WHEN OTHERS THEN dbms_output.put_line(SQLCODE||i."Q"||' '); END; end loop; end; / EXECUTE UTL_RECOMP.RECOMP_PARALLEL(4);