oracle(sql) 表名改成大写
declare
tablename1 varchar2(100);
str varchar2(100);
cursor c_mycursor is
select table_name from all_tab_comments where owner ='XYADMIN' and table_type = 'TABLE';
begin
open c_mycursor;
loop
fetch c_mycursor into tablename1;
exit when c_mycursor%notfound;
if tablename1 <> upper(tablename1) then
str:='alter table XYADMIN."'||tablename1||'" rename to '||tablename1;
execute immediate str;
end if;
end loop;
close c_mycursor;
end;
tablename1 varchar2(100);
str varchar2(100);
cursor c_mycursor is
select table_name from all_tab_comments where owner ='XYADMIN' and table_type = 'TABLE';
begin
open c_mycursor;
loop
fetch c_mycursor into tablename1;
exit when c_mycursor%notfound;
if tablename1 <> upper(tablename1) then
str:='alter table XYADMIN."'||tablename1||'" rename to '||tablename1;
execute immediate str;
end if;
end loop;
close c_mycursor;
end;