![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PL/SQL
王景远
这个作者很懒,什么都没留下…
展开
-
Oracle错误代码一览表
ORA-00001: 违反唯一约束条件 (.)ORA-00017: 请求会话以设置跟踪事件ORA-00018: 超出最大会话数ORA-00019: 超出最大会话许可数ORA-00020: 超出最大进程数 ()ORA-00021: 会话附属于其它某些进程;无法转换会话ORA-00022: 无效的会话 ID;访问被拒绝ORA-00023: 会话引用进程私用内存;无法分离会话转载 2012-02-21 17:34:21 · 712 阅读 · 0 评论 -
根据描述性弹性域的标题查找描述性弹性域表和列 .
/*根据描述性弹性域的标题查找描述性弹性域表和列*/ --select fnd_dfv.title, fnd_dfv.descriptive_flexfield_name, fnd_dfv.application_table_name, fnd_dfu.application_column_name, fnd_dfu.form转载 2013-01-18 17:45:01 · 619 阅读 · 0 评论 -
PL/SQL function解释
在SQL语句中调用的function不能含有DML语句,否则会报如下错误:ORA-14551: 无法在查询中执行 DML 操作 ; 在一般function中是可以有DML语句的。原创 2013-04-02 18:59:35 · 673 阅读 · 0 评论 -
物化视图
物化视图是一种特殊的物理表,“物化”(Materialized)视图是相对普通视图而言的。普通视图是虚拟表,应用的局限性大,任何对视图的查询,Oracle都实际上转换为视图SQL语句的查询。这样对整体查询性能的提高,并没有实质上的好处。 Oracle最早在OLAP系统中引入了物化视图的概念。但后来很多大型OLTP系统中,发现类似统计的查询是无可避免,而这些查询操作如果很频繁,对整体数据库性能转载 2013-04-03 17:05:56 · 447 阅读 · 0 评论 -
表连接
1,内连接([ Inner ] join): 1,等值连接,非等值连接([ Inner ] join) 2,自然连接(Natural join) 相同属性列,结果中去除相同属性列,是一种特殊的等值连接 3,交叉连接(Cross join) 迪卡尔乘积 没有where子句2,外连接(Outer join) 1,左外连接(Leftouter join/ left join原创 2013-04-03 17:24:42 · 504 阅读 · 0 评论 -
Oracle/PLSQL: WHERE CURRENT OF Statement
If you plan on updating or deleting records that have been referenced by aSelect For Update statement, you can use theWhere Current Of statement.译:如果你想删除或者更新被Select For Update引用的记录,你可以使用Where转载 2013-04-18 18:18:31 · 554 阅读 · 0 评论 -
merge into多表关联更新
http://www.cnblogs.com/highriver/archive/2011/08/02/2125043.html http://blog.csdn.net/inthirties/article/details/4731930原创 2013-09-11 17:40:26 · 3744 阅读 · 0 评论 -
cursor 与refcursor及sys_refcursor的区别
利用REF CURSOR,可以在程序间传递结果集(一个程序里打开游标变量,在另外的程序里处理数据)。也可以利用REF CURSOR实现BULK SQL,提高SQL性能。REF CURSOR分两种,Strong REF CURSOR 和 Weak REF CURSOR。Strong REF CURSOR:指定retrun type,CURSOR变量的类型必须和return转载 2013-10-09 17:26:52 · 1205 阅读 · 0 评论 -
oracle return into 用法
CREATE TABLE t1 (id NUMBER(10),description VARCHAR2(50),CONSTRAINT t1_pk PRIMARY KEY (id)); CREATE SEQUENCE t1_seq; INSERT INTO t1 VALUES (t1_seq.nextval, 'ONE'); INSERT INTO t1 VALUES (t1转载 2013-10-09 16:04:14 · 5000 阅读 · 0 评论 -
oracle中bulk collect into用法
通过bulk collect减少loop处理的开销 采用bulk collect可以将查询结果一次性地加载到collections中。 而不是通过cursor一条一条地处理。 可以在select into,fetch into,returning into语句使用bulk collect。 注意在使用bulk collect时,所有的into变量都必须是collections.转载 2013-10-09 16:03:17 · 28529 阅读 · 0 评论 -
绑定变量
首先用var进行声明,确定变量名及类型,再使用exec赋值。格式为“:变量名:=变量值”。“:=”为赋值符号,例如“SQL> exec :i:=:i+1;”。使用时通过“:变量名”方式调用。例如:SQL> var i varchar2(10);SQL> exec :i:='sql';SQL> select * from table_name where name=:i;转载 2013-01-15 20:35:37 · 402 阅读 · 0 评论 -
Get OU and Org
SELECT ood.organization_code, ood.organization_id, ood.organization_name, ood.operating_unit, hou.NAME ou_name, ood.legal_entity, ood.set_of_books_id,原创 2012-12-21 21:26:43 · 496 阅读 · 0 评论 -
Oracle pl/sql trim function
Oracle pl/sql trim functionThe trim function removed characters from beginning and/or end of a string in Oracle. Oracle has 3 functions for this:TRIMThe TRIM function trims specified characters翻译 2012-02-23 10:49:22 · 1270 阅读 · 0 评论 -
包,包体,过程的引用
1,包的specification里有的关于过程和函数的声明,在包的body里一定要实现;2,pkgname.proname只能引用specification里声明的过程或函数,没有声明但在body里写的,不能引用;3,包内的函数或过程可以和包外的同名原创 2012-02-22 18:08:02 · 342 阅读 · 0 评论 -
INDEX BY TABLE 记录索引表
/* Formatted on 2012/02/22 18:30 (Formatter Plus v4.8.7) */CREATE TABLE test_index_by_table_beke(my_name VARCHAR2(25),age NUMBER,creation_date DATE,created_by NUMBER,last_updat原创 2012-02-22 18:33:42 · 885 阅读 · 0 评论 -
oracle日期转换函数
1、转换函数 与date操作关系最大的就是两个转换函数:to_date(),to_char() to_date() 作用将字符类型按一定格式转化为日期类型: 具体用法:to_date(''2004-11-27'',''yyyy-mm-dd''),前者为字符串,后者为转换日期格式,注意,前后两者要以一对应。 如;to_date(''2004-1转载 2012-03-29 13:46:10 · 351 阅读 · 0 评论 -
trunc and round 函数的用法
截取select trunc(sysdate)from dual; 精确到日select trunc(sysdate,'dd')from dual; 精确到日select trunc(sysdate,'mm')from dual; 精确到月select trunc(sysdate,'yy')from dual; 精确到年selec原创 2012-02-23 17:00:57 · 568 阅读 · 0 评论 -
跨千年日期转换
CREATE ORREPLACEFUNCTION my_to_date(p_chr_dateINVARCHAR2)RETURNDATEISBEGINIF(p_chr_dateISNULL)THENRETURNNULL;ELSEIF(TO_DATE(p_chr_date,'dd-mm-yy原创 2012-04-05 19:49:54 · 283 阅读 · 0 评论 -
define curser and record
TYPE invoice_headerISRECORD( batch_source_name VARCHAR(50), remit_to_address_id VARCHAR(20), trx_date VARCHAR(20), purchase_order_number原创 2012-06-18 11:28:51 · 325 阅读 · 0 评论 -
serial number status
CREATE OR REPLACE VIEW MTL_ONHAND_SERIAL_MWB_V ASSELECT msn.current_organization_id organization_id, mp.organization_code organization_code, msn.current_subinventory_code subinventor原创 2012-12-19 20:01:36 · 934 阅读 · 0 评论 -
plsql dev 安装路径不能有空格
plsql dev 安装路径不能有空格,不然hu原创 2014-07-30 02:20:48 · 872 阅读 · 0 评论