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体系 ...
随机推荐
- https原理和如何配置https
参考:https://blog.51cto.com/11883699/2160032 上面说的已经很好地,我这里简单做个总结: 在网上我们做数据交互时候一般用的http协议,但是这种方式会使得交互内容 ...
- .net core 控制台程序生成EXE
在项目上右键编辑xxx.csproj,添加一行 <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
- bzoj3717 [PA2014]Pakowanie 贪心+状压DP
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=3717 题解 这道题大概也就只能算常规的状压 DP 吧,但是这个状态和转移的设计还是不是很好想. ...
- ubuntu 安装apache2 二进制包
官方安装教程 http://httpd.apache.org/docs/2.4/install.html 一.下载安装包 进入https://httpd.apache.org/download.cg ...
- webRTC脱坑笔记(四)— windows下Nginx对Node服务的反向代理
Nginx反向代理 1.什么是反向代理 当我们有一个服务器集群,并且服务器集群中的每台服务器的内容一样的时候,同样我们要直接从个人电脑访问到服务器集群服务器的时候无法访问,必须通过第三方服务器才能访问 ...
- "||" 在sql中有什么用
双竖线表示字符串拼接 比如: 'abc' || 'cba' 结果: 'abccba'
- boost compressedPair
boost::compressed_pair behaves like std::pair. However, if one or both template parameters are empty ...
- Struts2基础-2 -实现Action接口创建Action控制器
1.新建一个web项目,目录结构如下,添加jar包到lib文件夹里,并把jar包add 到 buildpath里面 2.web.xml配置 struts2的过滤器类:StrutsPrepareAndE ...
- Tomcat 中get请求中含有中文字符时乱码的处理
Tomcat 中get请求中含有中文字符时乱码的处理
- webpack对脚本和样式的处理
一.对js处理 webpack本身支持js加载也可以用插件. 1.加载要全局使用的插件比如jquery 在页面用cdn方式引用,然后再webpack.config.js里配置.会让jquery成为全局 ...