ORA-00904: : invalid identifier
479297Nov 16 2007 — edited Nov 16 2007----------------------------------------------------
set feedback off
set verify off
set serveroutput on
set termout on
exec dbms_output.put_line('Starting build select of columns to be altered');
drop table semantics$
/
create table semantics$(s_owner varchar2(40),
s_table_name varchar2(40),
s_column_name varchar2(40),
s_data_type varchar2(40),
s_char_length number)
/
insert into semantics$
select C.owner, C.table_name, C.column_name, C.data_type, C.char_length
from all_tab_columns C, all_tables T
where C.owner = T.owner
and T.owner not in ('SYS', 'SYSTEM', 'CTXSYS', 'DBSNMP', 'DMSYS',
'EXFSYS', 'HR', 'IX', 'MDSYS', 'OE', 'OLAPSYS',
'ORDSYS', 'OUTLN', 'SH', 'SYSMAN', 'WKSYS',
'WK_TEST', 'WMSYS', 'XDB')
and C.table_name = T.table_name
and C.table_name not in (select table_name from all_external_tables)
and C.data_type in ('VARCHAR2', 'CHAR')
-- You can exclude or include tables or schemas as you wish, by adjusting
-- "and T.owner not in" as per your requirements
/
commit
---------------------------------------------------------------------------
declare
cursor c1 is select * from semantics$;
v_statement varchar2(500);
v_nc number(10);
v_nt number(10);
row_count number;
begin
execute immediate
'select count(*) from semantics$' into v_nc;
execute immediate
'select count(distinct s_table_name) from semantics$' into v_nt;
dbms_output.put_line
('ALTERing ' || v_nc || ' columns in ' || v_nt || ' tables');
for r1 in c1 loop
v_statement := 'ALTER TABLE ' || r1.s_owner || '.' || r1.s_table_name;
v_statement := v_statement || ' modify (' || r1.s_column_name || ' ';
v_statement := v_statement || r1.s_data_type || '(' || r1.s_char_length;
v_statement := v_statement || ' CHAR))';
execute immediate v_statement;
end loop;
dbms_output.put_line('Done');
end;
/
---------------------------------------------------------------------------
when i run the above script...i am getting the following error..
semantics$ tables contains 10,500 Rows in my database.........
-------------------------------------------------------------------
declare
*
ERROR at line 1:
ORA-00904: : invalid identifier
ORA-06512: at line 18
-----------------------------------------------------------
what might be the problem..is it the problem with the Buffer...or pl/sql block allters only 3000 Rows at a time...
friends pls help me