[20141004]ORA-01873.txt

简介: [20141004]ORA-01873 the leading precision of the interval is too small.txt --前几天运行的报表,出现错误ORA-01873 the leading precision of the interval is too small.

[20141004]ORA-01873 the leading precision of the interval is too small.txt

--前几天运行的报表,出现错误ORA-01873 the leading precision of the interval is too small.txt.
--出现错误语句含有如下:
to_date('2014-09-30 23:59:59')-interval '120' day;

$ oerr ora 1873
oerr ora 1873
01873, 00000, "the leading precision of the interval is too small"
// *Cause: The leading precision of the interval is too small to store the
//  specified interval.
// *Action: Increase the leading precision of the interval or specify an
//  interval with a smaller leading precision.

--我还第一次看到有人在程序中interval,如果把前面改成99小于100的天数,程序可以通过.

SQL> select * from emp  where hiredate select * from emp  where hiredate                                                      *
ERROR at line 1:
ORA-01873: the leading precision of the interval is too small

SQL> select * from emp  where hiredate      EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800                    20
      7499 ALLEN      SALESMAN        7698 1981-02-20 00:00:00       1600        300         30
      7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
      7566 JONES      MANAGER         7839 1981-04-02 00:00:00       2975                    20
...

SQL> @dpc '' ''
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------
SQL_ID  3c476wmxtgbum, child number 0
-------------------------------------
select * from emp  where hiredate Plan hash value: 3956160932
--------------------------------------------------------
| Id  | Operation         | Name | E-Rows | Cost (%CPU)|
--------------------------------------------------------
|   0 | SELECT STATEMENT  |      |        |     3 (100)|
|*  1 |  TABLE ACCESS FULL| EMP  |     14 |     3   (0)|
--------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter("HIREDATE"              SECOND(0))

--注意看day后面有一个括号(2),是否改写如下可以通过.

select * from emp  where hiredate

SQL> select * from emp  where hiredate      EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800                    20
      7499 ALLEN      SALESMAN        7698 1981-02-20 00:00:00       1600        300         30
      7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
...
--可以通过.

select * from emp  where hiredate select * from emp  where hiredate --通过

SQL> select * from emp  where hiredate select * from emp  where hiredate                                                      *
ERROR at line 1:
ORA-01873: the leading precision of the interval is too small

--看来与天数的位数有关.

我的建议还是不要采用如下写法.
直接减去一个数字就可以了.
select * from emp  where hiredate

目录
相关文章
|
Oracle 关系型数据库
[20180502]ORA-01580.txt
[20180502]ORA-01580.txt RMAN> backup current controlfile; Starting backup at 2018-05-02 15:36:03 using channel ORA_DISK_1 using...
1174 0
|
关系型数据库 Oracle Linux
[20180321]ORA-08180.txt
[20180321]ORA-08180.txt $ oerr ora 08180 08180, 00000, "no snapshot found based on specified time" // *Cause: Could not match the time to an SCN from the mapping table.
1297 0
|
Oracle 关系型数据库 数据库
[20171208]ORA-16014(10G).txt
[20171208]ORA-16014(10G).txt --//别人配置dg遇到的问题,当时没有记录.在自己的环境做一个演示.这个问题相对隐藏很深.主要是自己不注意这些细节.
1202 0
|
Oracle 关系型数据库 Linux
|
关系型数据库 Oracle Linux
[20170628]12C ORA-54032.txt
[20170628]12C ORA-54032.txt https://hourim.wordpress.com/2017/06/24/ora-54032-column-to-be-renamed-is-used-in-a-virtual-column-expres...
1460 0
|
SQL 网络协议 Oracle
[20170419]ora-28547.txt
[20170419]ora-28547.txt --//测试环境,莫名奇妙使用toad登陆出现如下错误(使用ezconnect方式)。 ORA-28547: connection to server failed, probable Oracle Net adm...
1412 0
[20160623]ora-00445.txt
[20160623]ora-00445.txt Wed Jun 22 07:38:25 2016 Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_smco_3976.
1323 0
|
测试技术
[20160311]ora-01732.txt
[20160311]ora-01732.txt --今天工作出现ora-01732错误,做一个测试例子,做一个记录: 1.环境: SCOTT@test01p> @ ver1 PORT_STRING          VERSION     BANNER    ...
995 0
|
SQL Oracle 关系型数据库
[20151215]ORA-60014.txt
[20151215]ORA-60014: invalid MAXSIZE storage option value.txt SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        ...
846 0
|
SQL
[20150707]ORA-00932.txt
[20150707]ORA-00932: inconsistent datatypes: expected - got CLOB.txt --自己写一个通过sql_id查看sql语句的脚本: column sqltext format a200 sele...
777 0