对自定义函数建立索引时抛异常--ORA-30553: 函数不能确定(ORA-30553: The function is not deterministic)解决方法
2009-03-13 08:51
696 查看
对自定义函数建立索引时抛异常--ORA-30553: 函数不能确定(ORA-30553: The function is not deterministic)解决方法
问题描述:
SQL> create or replace function f_16turnto10(
2 str_16char in varchar2
3 )return integer
4 is
5 i_number number(10);
6 i_int int;
7 begin
8 i_int := length(str_16char)+10;
9 i_number := to_number(str_16char,rpad('x',i_int,'x'));
10 return i_number;
11 end;
12 /
Function created
SQL> create table t_16turn10 as select username,'4D' as psw from dba_users;
Table created
SQL> create index i_16turn10 on t_16turn10 (f_16turnto10(psw));
create index i_16turn10 on t_16turn10 (f_16turnto10(psw))
ORA-30553: 函数不能确定
解决如下:
如果需要创建基于自定义函数的索引,那么我们需要指定deterministic参数,在函数建立的时候指定该参数问题可解决。
SQL> create or replace function f_16turnto10(
2 str_16char in varchar2
3 )return integer deterministic
4 is
5 i_number number(10);
6 i_int int;
7 begin
8 i_int := length(str_16char)+10;
9 i_number := to_number(str_16char,rpad('x',i_int,'x'));
10 return i_number;
11 end;
12 /
Function created
SQL> create table t_16turn10 as select username,'4D' as psw from dba_users;
Table created
SQL> create index i_16turn10 on t_16turn10 (f_16turnto10(psw));
Index created
问题描述:
SQL> create or replace function f_16turnto10(
2 str_16char in varchar2
3 )return integer
4 is
5 i_number number(10);
6 i_int int;
7 begin
8 i_int := length(str_16char)+10;
9 i_number := to_number(str_16char,rpad('x',i_int,'x'));
10 return i_number;
11 end;
12 /
Function created
SQL> create table t_16turn10 as select username,'4D' as psw from dba_users;
Table created
SQL> create index i_16turn10 on t_16turn10 (f_16turnto10(psw));
create index i_16turn10 on t_16turn10 (f_16turnto10(psw))
ORA-30553: 函数不能确定
解决如下:
如果需要创建基于自定义函数的索引,那么我们需要指定deterministic参数,在函数建立的时候指定该参数问题可解决。
SQL> create or replace function f_16turnto10(
2 str_16char in varchar2
3 )return integer deterministic
4 is
5 i_number number(10);
6 i_int int;
7 begin
8 i_int := length(str_16char)+10;
9 i_number := to_number(str_16char,rpad('x',i_int,'x'));
10 return i_number;
11 end;
12 /
Function created
SQL> create table t_16turn10 as select username,'4D' as psw from dba_users;
Table created
SQL> create index i_16turn10 on t_16turn10 (f_16turnto10(psw));
Index created
相关文章推荐
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- 函数索引 ORA-30553: The function is not deterministic 解决方法
- ORA-30553: The function is not deterministic
- MavenReportException:The environment variable JAVA_HOME is not correctly set.错误异常解决方法
- Virtual Disk "hard disk 3' is not accessible on the host 虚拟机不能启动的解决方法
- 从WinForm程序中显示WPF Window出现"The URI prefix is not recognized"异常的解决方法
- Enterprise Manager is not able to connect to the database instance.(ORA-28001)错误的解决方法[转载]
- xxx is not in the sudoers file 和 Authority XXX 不能sudo解决方法
- PHP Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. 解决方法:
- 异常:System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms 这个实现是不是Windows平台FIPS验证的加密算法。解决方法
- linux系统使用sudo命令报xxx is not in the sudoers file.This incident will be reported.的解决方法
- mysql 函数/存储过程的The user specified as a definer ('root'@'%') does not exist 解决方法
- oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法
- 转:HTTP Status 404(The requested resource is not available)的几种解决方法
- the network bridge on device vmnet0 is not running解决方法
- The function equals must be used with a prefix when a default namespace is not specified解决