ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-01743: only pure functions can be indexed

ORA-01743: only pure functions can be indexed

原创 Linux操作系统 作者:dragondb 时间:2019-03-01 11:06:04 0 删除 编辑

SQL> create table test(c1 int,c2 varchar2(10));

Table created.

SQL> create index test_idx_01 on test(to_date(c2,'YYMMDD'));
create index test_idx_01 on test(to_date(c2,'YYMMDD'))
                                         *
ERROR at line 1:
ORA-01743: only pure functions can be indexed

对于FBI,所使用的函数必须是DETERMINISTIC,就是说任何时候被调用其始终返回相同的结果,在上面因为年份只取了后两位,这是一个不确定的值,因而报错了:

SQL> create index test_idx_01 on test(to_date('20'||c2,'YYYYMMDD'));

Index created.

SQL>

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/45259/viewspace-663825/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2003-05-05

  • 博文量
    98
  • 访问量
    94093