Home » Developer & Programmer » Designer » want to modify multiple empty tables
want to modify multiple empty tables [message #90471] Wed, 05 November 2003 06:27 Go to next message
Emma
Messages: 12
Registered: November 2001
Junior Member
Hi,

I have 45 tables that contain a field called 'CODE' which has a datatype of VARCHAR2 and data length of 5.I
want to modify all these tables so that the CODE field will have a data length of 6.
I have tried running the following .sql but i am getting the below errors.
begin
for v in (select * from dba_Tab_columns where owner = 'USER' and column_name = 'CODE'
and data_type = 'VARCHAR2' and data_length = 5)
loop

execute immediate 'alter table USER.'||v.table_name||' modify '||v.column_name||'
varchar2(6)';
end loop;
end;
Re: want to modify multiple empty tables [message #90474 is a reply to message #90471] Fri, 07 November 2003 14:20 Go to previous message
inna
Messages: 6
Registered: July 2002
Junior Member
you forgot to include parenteces, and you need empty space between column name and datatype
like this:

execute immediate 'alter table USER.'||v.table_name||' modify ('||v.column_name||' varchar2(6))'
Previous Topic: Give me a General Database Deign that will be sufficing an average database size
Next Topic: Defing Primary key
Goto Forum:
  


Current Time: Wed Nov 26 04:22:50 CST 2014

Total time taken to generate the page: 0.10443 seconds