oracle deterministic关键字
http://inthirties.com:90/viewthread.jsp?tid=1395
这个deterministic是不是很眼熟呀,
我们在online redefinition里见到过这个关键字,这个关键在在自定义的函数索引里也出现了。
先看看文档
DETERMINISTIC Clause
Specify DETERMINISTIC to indicate that the function returns the same
result value whenever it is called with the same values for its
arguments.
You must specify this keyword if you intend to call the function in
the expression of a function-based index or from the query of a
materialized view that is marked REFRESH FAST or ENABLE QUERY REWRITE.
When Oracle Database encounters a deterministic function in one of these
contexts, it attempts to use previously calculated results when
possible rather than reexecuting the function. If you subsequently
change the semantics of the function, you must manually rebuild all
dependent function-based indexes and materialized views.
Do not specify this clause to define a function that uses package
variables or that accesses the database in any way that might affect the
return result of the function. The results of doing so will not be
captured if Oracle Database chooses not to reexecute the function.
The following semantic rules govern the use of the DETERMINISTIC
clause:
*You can declare a top-level subprogram DETERMINISTIC.
*You can declare a package-level subprogram DETERMINISTIC in the
package specification but not in the package body.
*You cannot declare DETERMINISTIC a private subprogram (declared
inside another subprogram or inside a package body).
*A DETERMINISTIC subprogram can call another subprogram whether the
called program is declared DETERMINISTIC or not.
要实现自己的函数,加入函数索引,必须加入这个deterministic关键字,保证你这行的返回是一个确定数。
否则出现
30553, 00000, “The function is not deterministic”
// *Cause: The function on which the index is defined is not
deterministic
// *Action: If the function is deterministic, mark it
DETERMINIS
相关文档:
好长时间没写东东了,今天写了一个oracle的分页存储过程,贴出来与大家分享。
由于。net框架中的gridview等控件的分页功能太弱,所以大部分程序员都会自己写分页功能,而调用分页存储过程是必须的。
前台aspx页面不管是用下载的dll还是用自己写的用户控件,都能实现自己的功能,然而分页的存储过程就需要好好的考虑了,下 ......
oracle分析函数十分强大,我们只要掌握这些方法,更直接的说法就是知道这些分析函数的作用就能完成很多工作。
下边贴出这些函数,及简单应用。
其中我想对lag()和lead()函数坐下说明:lag()本身是延后的意思也就是延后出现某列的数,而lead()有引领、领先的意思也就是提前几行显示某列数据
RANK()
dense_rank() ......
Actions
Every action belongs to an action type. An action type is a collection of actions having similar functionality. For example, actions in the absolute-job-level action type all require approvals up to a certain job level in the HR supervisory hierarchy.
每个行为都属于一种行为类型。每种行为类 ......
---------------oracle 入门
打开服务器
net start oracleserviceORCL
打开监听器
lsnrctl start
关闭服务器
net stop oracleserviceORCL
关闭监听器
lsnrctl stop
-----------------------------
1.创建表
Create table 表名
(字段名 数据 ......