[navicate将mysql数据库数据复制到oracle数据库]--批量将oracle 表名和字段名变为大写
begin
for c in (select table_name tn from user_tables where table_name <> upper(table_name)) loop
begin
execute immediate 'alter table "'||c.tn||'" rename to '||c.tn;
exception
when others then
dbms_output.put_line(c.tn||'已存在');
end;
end loop;
end;
2.批量将空间内所有表的所有字段名变成大写
begin
for t in (select table_name tn from user_tables) loop
begin
for c in (select column_name cn from user_tab_columns where table_name=t.tn) loop
begin
execute immediate 'alter table "'||t.tn||'" rename column "'||c.cn||'" to '||c.cn;
exception
when others then
dbms_output.put_line(t.tn||'.'||c.cn||'已经存在');
end;
end loop;
end;
end loop;
end;
begin
for t in (select table_name tn from user_tables where table_name <> upper(table_name)) loop
begin
for c in (select column_name cn from user_tab_columns where table_name=t.tn) loop
begin
execute immediate 'alter table "'||t.tn||'" rename column "'||c.cn||'" to '||c.cn;
exception
when others then
dbms_output.put_line(t.tn||'.'||c.cn||'已经存在');
end;
end loop;
execute immediate 'alter table "'||t.tn||'" rename to '||t.tn;
exception
when others then
dbms_output.put_line(t.tn||'已存在');
end;
end loop;
end;
相关文章
- 【MySQL高级】Mysql的体系结构概览及存储引擎以及索引的使用
- Oracle数据库刷题笔记,mysql刷题笔记
- Oracle数据库:oracle用命令定义非空not null,unique唯一性,主键primary key,外键foreign key,check检查,启用enable,禁用disable约束
- Oracle数据库:oracle外连接left/right/full outer join on,oracle扩展的左右外连接展示符号(+)
- Oracle数据库:oracle数据类型转换to_char()日期和数字转字符,to_number()字符转数字,to_date()字符转日期函数
- Oracle数据库:oracle函数,单行函数,多行函数,upper,lower,initcap,字符串函数
- Oracle数据库:oracle字符类型、数字类型、创建表表名的命名规则
- Oracle数据库:oracle 11g安装教程,已安装好的oracle各个文件夹的作用,oracle用户权限怎么样
- 【MySQL进阶-06】深入理解mysql的内核查询成本计算
- Linux安装MySQL(只针对这个8.0版本其他版本的MYSQL不知道是不是也可以用可以自己尝试)
- 【Oracle】ORACLE SQL Developer不支持JAVA版本
- 【docker】dbclient远程访问非本机数据库(mysql,oracle,postgres,sqlserver/mssql),测试远程数据库连通性
- .NET/Mysql-petatoco连接mysql数据库
- sql server 导出的datetime结果 CAST(0x00009E0E0095524F AS DateTime) 如何向mysql,oracle等数据库进行转换
- jboss7.1.1配置数据库mysql与oracle
- Mysql Order By 字符串排序,mysql 字符串order by
- Sqoop是一款开源的工具,主要用于在HADOOP(Hive)与传统的数据库(mysql、oracle...)间进行数据的传递
- [Oracle工程师手记] 通过 lsof 命令查找oracle client 端和 server 端进程
- PostgreSQL通过mysql_fdw访问MySQL数据库
- (5.8)mysql高可用系列——MySQL中的GTID复制(实践篇)
- 【C#】使用MySql.Data.dll连接MySQL数据库
- MySQL 安装mysql数据库
- python封装一个工具类 ,对MySQL数据库增删改查,可多字段动态插入mysql数据库中