【Oracle】ORA-30553: 函数不确定的解决办法
来源:互联网 发布:小微企业会计核算软件 编辑:程序博客网 时间:2024/06/06 05:50
如果需要创建基于自定义函数的索引,那么我们需要指定deterministic参数,在函数建立的时候指定该参数问题可解决。
SQL>
CREATE
OR
REPLACE
FUNCTION
f_xifenfei (itime
DATE
)
2
RETURN
DATE
3
IS
4 otime
DATE
;
5
BEGIN
6 otime:=NVL(itime,SYSDATE);
7
RETURN
otime;
8
END
;
9 /
Function
created.
--想采用自定义函数屏蔽掉sysdate在创建index时候的影响
SQL>
create
index
in_t_xifenfei
on
t_xifenfei (f_xifenfei(intime)) online nologging;
create
index
in_t_xifenfei
on
t_xifenfei (f_xifenfei(intime)) online nologging
*
ERROR
at
line 1:
ORA-30553: The
function
is
not
deterministic
SQL> !oerr ora 30553
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 DETERMINISTIC. If it
//
is
not
deterministic (it depends
on
package state,
database
state,
//
current
time
,
or
anything other than the
function
inputs)
then
// do
not
create
the
index
. The
values
returned
by
a deterministic
//
function
should
not
change even
when
the
function
is
rewritten
or
// recompiled.
--因为函数缺少deterministic不能使用于index上
SQL>
CREATE
OR
REPLACE
FUNCTION
f_xifenfei (itime
DATE
)
2
RETURN
DATE
deterministic
3
IS
4 otime
DATE
;
5
BEGIN
6 otime:=NVL(itime,SYSDATE);
7
RETURN
otime;
8
END
;
9 /
Function
created.
SQL>
create
index
in_t_xifenfei
on
t_xifenfei (f_xifenfei(intime)) online nologging;
Index
created.
--创建函数index成功
0 0
- 【Oracle】ORA-30553: 函数不确定的解决办法
- 参数个数不确定的函数
- python 函数不确定的参数
- 不确定的函数参数核算
- 关于ORACLE ORA-01846 错误的解决办法
- oracle错误ora-01658的解决办法
- oracle错误ora-01658的解决办法
- Oracle 的 ORA-31605 错误解决办法
- Oracle数据库ORA-12514错误的解决办法
- Oracle 的 ORA-01653 错误解决办法
- [Oracle] expdp ORA-39006, ORA-39065 的解决办法
- 登录 oracle 时 ORA-01034 和 ORA-27101 的解决办法
- Oracle expdp ORA-39006, ORA-39065的解决办法
- oracle ORA-01031解决办法
- 【ORACLE】ORA-28000 the account is locked-的解决办法;ORA-39001,ORA-39000,ORA-39143
- 不确定参数个数的函数的实现
- javascript 不确定的函数的执行
- 不确定参数个数的函数的实现
- 使用Qemu模拟Cortex-A9运行U-boot和Linux
- 别让自己受hater的影响,坚持自己的思想!
- glib中hash table
- Java NIO系列教程(三) Buffer
- Git笔记(一)——[commit, checkout]
- 【Oracle】ORA-30553: 函数不确定的解决办法
- Jsoup学习之Whitelist类
- Android无法访问本地服务器(localhost)的解决方案
- 在CString中如何获取自己想要的字符串
- Android好奇宝宝_03_有点坑的GridView
- 应用scikit-learn做文本分类
- Java NIO系列教程(四) Scatter/Gather
- HTTP 状态代码含义
- 淘宝小号转让免费货源免费提升销量免费开店免费教淘宝知识