随笔分类 -  sql

摘要:--用户名不区分大小写--删除用户表空间drop user &用户名 cascade;drop tablespace &永久表空间名称 including contents and datafiles; drop tablespace &临时表空间名称 including contents and 阅读全文
posted @ 2018-05-01 13:32 AlisonGavin 阅读(378) 评论(0) 推荐(0)
摘要:1、如果是在两个表联合查询更新表字段值时发生“ORA-01410: 无效的 ROWID”错误, 那么本站之前有讨论过它的解决方法,详见http://www.aiphere.com/oracle-for-update-invalid-rowid.html 2、如果仅仅是查询时发生“ORA-01410: 阅读全文
posted @ 2018-03-05 15:37 AlisonGavin 阅读(26614) 评论(0) 推荐(0)
摘要:> 链接 执行插入语句,在查询时出现错误,提示ORA-01830: 日期格式图片在转换整个输入字符串之前结束 to_date('2005/04/21 12:00:00', 'yyyy-MM-DD HH24:MI'); 原因: 这里是时间的长度大于格式的长度。 解决: 确保生成后的SQL为:to_da 阅读全文
posted @ 2018-02-27 16:04 AlisonGavin 阅读(3141) 评论(0) 推荐(0)
摘要:oracle中函数和存储过程的区别和联系 阅读全文
posted @ 2018-02-02 16:41 AlisonGavin 阅读(99) 评论(0) 推荐(0)
摘要:https://jingyan.baidu.com/article/3a2f7c2e144d2826aed61167.html 阅读全文
posted @ 2018-01-08 18:06 AlisonGavin 阅读(253) 评论(0) 推荐(0)
摘要:一般程序包出现该问题,都是程序包的问题, 先检查一下程序包的问题,在看其他的。 >http://www.lxway.com/586292514.htm 阅读全文
posted @ 2018-01-08 17:58 AlisonGavin 阅读(1708) 评论(0) 推荐(0)
摘要:修改数据update语法: update table_name set column_name1=data1, column_name2=data2,...(where codition) ; 阅读全文
posted @ 2018-01-08 14:58 AlisonGavin 阅读(269) 评论(0) 推荐(0)
摘要:/** 校正数据表和对应的序列 使用方法:在 SQL 窗口执行 call PROC_CORRECT_TABLEANDSEQ('表名','序列字段名','序列名');*/ create or replace procedure PROC_SEQ_RESET(v_seqname varchar2)asn 阅读全文
posted @ 2018-01-08 14:10 AlisonGavin 阅读(286) 评论(0) 推荐(0)
摘要:--用户名不区分大小写--删除用户表空间drop user &用户名 cascade;drop tablespace &永久表空间名称 including contents and datafiles; drop tablespace &临时表空间名称 including contents and 阅读全文
posted @ 2018-01-08 14:09 AlisonGavin 阅读(673) 评论(0) 推荐(0)
摘要:给scott用户解锁, 以sysdba用户进入 alter user scott account unlock; 给scott用户设置密码 alter user scott identified by tiger; 创建用户wpms created user wpms identified by w 阅读全文
posted @ 2018-01-08 14:03 AlisonGavin 阅读(169) 评论(0) 推荐(0)
摘要:利用游标cursor 阅读全文
posted @ 2018-01-08 13:59 AlisonGavin 阅读(393) 评论(0) 推荐(0)
摘要:1. SQL*plus是什么?SQL*plus是一个工具,可以为window、unix系统提供命令行工具,是一个用来输入和执行SQL语句并显示输出结果的纯文本环境。 2. 连接方式,两种 前提: 在$ORACLE_HOME/network/admin/tnsnames.ora配置连接符 2.1 通过 阅读全文
posted @ 2017-11-14 13:20 AlisonGavin 阅读(268) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/ytfy12/article/details/52488797 阅读全文
posted @ 2017-11-01 10:22 AlisonGavin 阅读(4939) 评论(0) 推荐(0)
摘要:插入数据方式-- 插入一条数据1. insert into table_a(field1, field2) values(v01, v02); --插入多条数据2. insert into table_a(field1, field2) values(v01, v02), (v101,v102), 阅读全文
posted @ 2017-10-19 19:27 AlisonGavin 阅读(291) 评论(0) 推荐(0)
摘要:oracle中的exists 和not exists 用法详解 http://blog.csdn.net/zhiweianran/article/details/7868894 阅读全文
posted @ 2017-08-22 23:46 AlisonGavin 阅读(398) 评论(0) 推荐(0)
摘要:参看1 参看2 阅读全文
posted @ 2017-08-16 16:47 AlisonGavin 阅读(136) 评论(0) 推荐(0)
摘要:declare cursor s_cur is select table_name from user_tables where upper(table_name) like upper('pms%'); --定义一个游标变量c_r s_cur%rowtype ,该类型为游标s_cur中的一行数据类型 c_r s_cur%ROWTYPE; begin for r in s_cur loop... 阅读全文
posted @ 2017-08-16 16:03 AlisonGavin 阅读(206) 评论(0) 推荐(0)
摘要:1. INNER JOIN 产生的结果是AB的交集 SELECT * FROM TableA INNER JOIN TableB ON TableA.id = TableB.rec_id 2. LEFT (OUTER) JOIN 产生表A的完全集,而表B中匹配的则有值,没有匹配的则以null值取代. 阅读全文
posted @ 2017-08-10 13:33 AlisonGavin 阅读(14263) 评论(0) 推荐(0)
摘要:create or replace function fn_substrnum(colname in varchar2, old_str in varchar2) return varchar2 is subnum number(10); ... 阅读全文
posted @ 2017-07-18 09:34 AlisonGavin 阅读(1439) 评论(0) 推荐(0)
摘要:ORACLE中,单引号有两个作用: 1.字符串是由单引号引用 2.转义 转义的的用法: 两个单引号表示转义 转载:http://blog.csdn.net/heqiyu34/article/details/7692188 阅读全文
posted @ 2017-07-17 18:39 AlisonGavin 阅读(1812) 评论(0) 推荐(0)