PL/SQL to update all columns
undefine schema_name;
declare
l_Err varchar2(200);
begin
for r in (select atc.table_name, atc.column_name, atc.data_length
from all_tab_columns atc, all_tables tab WHERE atc.owner=tab.OWNER and atc.table_name=tab.table_name
and atc.data_type = 'VARCHAR2'
and atc.char_used = 'B' --Indicates that the column uses BYTE length semantics (B) or CHAR length semantics (C)
-- and atc.table_name = 'xx' --TEST
and atc.owner = upper('&&schema_name'))
loop
begin
execute immediate 'alter table '|| upper('&&schema_name')
|| '.'
|| r.table_name
|| ' modify '
|| r.column_name
|| ' varchar2('
|| r.data_length
|| ' char)';
end;
commit;
end loop;
end;
/
PL/SQL to update all columns的更多相关文章
- 【转】PL/SQL编辑数据"这些查询结果不可更新,请包括ROWID或使用SELECT...FOR UPDATE获得可更新结果"处理
[转]PL/SQL编辑数据"这些查询结果不可更新,请包括ROWID或使用SELECT...FOR UPDATE获得可更新结果"处理 只要有人用了: select t.* from ...
- PL/SQL:these query result are not updateable,include the ROWID to get updateab -----for update
these query result are not updateable,include the ROWID to get updateab 原因: 其实,选中一个表后,右键,如果选择“query ...
- SQL with PL/SQL
DDL commands --> create user / table / view / sequence alter DML --> data manipulation languag ...
- PL/SQL : Procedural Language / Structual Query Language and it is an exrension to SQL.
SQL is not very flexible and it cannot be made to react differently to differing sutuations easily. ...
- pl/sql tutorial
http://plsql-tutorial.com/plsql-procedures.htm What is PL/SQL? PL/SQL stands for Procedural Language ...
- PL SQL Developer 使用总结
如果OS为windows 7 64位系统,Oracle版本为 Oracle 11g 64 安装PL SQL Developer 请参考 http://myskynet.blog.51cto.co ...
- pl sql练习(4)
1.ROW_NUMBER 返回连续的排位,不论值是否相等 select deptno,ename,sal, row_number () over (partition by deptno order ...
- pl/sql oracle
http://uule.iteye.com/blog/2061773(出处) 批量导入脚本: 打开一个command window > 输入@ > 它会让你选择要导入的文件 (自己要知道 ...
- 第三章 PL/SQL编程
3.1 PL/SQL基础知识 3.1.1 什么是PL/SQL? PL/SQL是结合Oracle过程语言和结构化查询语言的一种扩展语言 3.1.1.1 PL/SQL体系 ...
随机推荐
- mongdb 简介以及安装
1.什么是MongoDB? MongoDB 是由C++语言编写的,是一个基于分布式文件存储的开源数据库系统.在高负载的情况下,添加更多的节点,可以保证服务器性能.MongoDB 旨在为WEB应用提供 ...
- No enclosing instance of type TestGson is accessible. Must qualify the allocation with an enclosing instance of type TestGson (e.g. x.new A() where x is an instance of TestGson).
main方法中实例化内部类报错: public class TestGson { public static void main(String[] args) { Gson gson=new Gson ...
- canvas 绘制二次贝塞尔曲线
代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...
- bzoj3717 [PA2014]Pakowanie 贪心+状压DP
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=3717 题解 这道题大概也就只能算常规的状压 DP 吧,但是这个状态和转移的设计还是不是很好想. ...
- C# 创建日志
public void Log(string message) { try { string logFileName = "c:\\log\\LogName" + DateTime ...
- spring+springMVC+mybatis框架整合——配置文件说明
如下图 web.xml配置说明: spring配置文件说明-1: spring配置文件说明-2: spring配置助记: 扫注(base) 读配(loc) 数据源(和comb(使用c3p0数据源)) ...
- UIStakView的添加与移除
subView和arrangedSubView对于Stack View的子控件添加和移除,我们是这样描述的. 添加-->(Stack View管理的subview) addArrangedSub ...
- lua实现简单
MessageManager.lua local messageManager = {mEventTable = {},mEventUserData = {}} --注册事件function mess ...
- static、final修饰的变量和方法能否被继承的问题
首先定义父类和子类 public class Parent { protected static String a = "static"; final String b = &qu ...
- 简记 jQuery 插件模板
/** * @lisence jquery plugin demo v1.0.0 * * author: Jeremy Yu * * description: * this is a jquery p ...