[20181017]ORA-01873 the leading precision of the interval is too small.txt
[20181017]ORA-01873 the leading precision of the interval is too small.txt
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
SCOTT@test01p> SELECT TO_TIMESTAMP('1970-01-01 00:00:00.0','YYYY-MM-DD HH24:MI:SS.FF') + NUMTODSINTERVAL(2850166802000/1000, 'SECOND') FROM DUAL;
SELECT TO_TIMESTAMP('1970-01-01 00:00:00.0','YYYY-MM-DD HH24:MI:SS.FF') + NUMTODSINTERVAL(2850166802000/1000, 'SECOND') FROM DUAL
*
ERROR at line 1:
ORA-01873: the leading precision of the interval is too small
D:\tools\rlwrap>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.
--//按照作者解析:
Problem identified – it's a numeric limit of the numtodsinterval() function. Interestingly it's not documented in the
Oracle manuals, in fact the SQL Reference manual suggests that this shouldn't be a limit because it says that "any
number value or anything that can be cast as a number is legal" and in Oracle-speak a number allows for roughly 38
digits precision.
SCOTT@test01p> SELECT NUMTODSINTERVAL(power(2,31)-1, 'SECOND') from dual;
NUMTODSINTERVAL(POWER(2,31)-1,'SECOND')
---------------------------------------------------------------------------
+000024855 03:14:07.000000000
--//2850166802000/1000-2^31 = 702683154,遠遠大於2^31.
--//改用分鐘OK.
SCOTT@test01p> SELECT TO_TIMESTAMP('1970-01-01 00:00:00.0','YYYY-MM-DD HH24:MI:SS.FF') + NUMTODSINTERVAL(2850166802000/1000/60, 'MINUTE') FROM DUAL;
TO_TIMESTAMP('1970-01-0100:00:00.0','YYYY-MM-DDHH24:MI:SS.FF')+NUMTODSINTER
---------------------------------------------------------------------------
2060-04-26 01:00:02.000000000
--//突然想起以前的測試:
--//連結:[20180927]ora-01426.txt=>http://blog.itpub.net/267265/viewspace-2215090/
set serveroutput on
DECLARE
L_NUMBER number;
BEGIN
L_NUMBER := 1024 * 1024 * 1024 * 1024;
DBMS_OUTPUT.PUT_LINE(L_NUMBER);
END;
/
DECLARE
*
ERROR at line 1:
ORA-01426: numeric overflow
ORA-06512: at line 4
$ oerr ora 1426
01426, 00000, "numeric overflow"
// *Cause: Evaluation of an value expression causes an overflow/underflow.
// *Action: Reduce the operands.
set serveroutput on
DECLARE
L_NUMBER number;
a number;
BEGIN
a := 1;
L_NUMBER := a * 1024 * 1024 * 1024 * 1024;
DBMS_OUTPUT.PUT_LINE(L_NUMBER);
L_NUMBER := 1024 * 1024 * 1024 * 1024;
DBMS_OUTPUT.PUT_LINE(L_NUMBER);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(sqlerrm);
dbms_output.put_line( dbms_utility.format_error_backtrace);
END;
/
1099511627776
ORA-01426: numeric overflow
ORA-06512: at line 10
PL/SQL procedure successfully completed.
--//第1個賦值左邊有變數存在,所以正常. 而第2個全部是常量,超出2^31報錯.
--//很明顯oracle在一個算式裡面達到2^31 就報錯.改成如下也不會報錯
DECLARE
L_NUMBER number;
BEGIN
-- L_NUMBER := 2147483647-1+1;
L_NUMBER := 2147483647;
L_NUMBER := L_NUMBER+1-1;
DBMS_OUTPUT.PUT_LINE(L_NUMBER);
END;
/
--//我覺得這個問題與前面的問題實際上還不同.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2216855/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Interval
- leetcode–57–Insert IntervalLeetCode
- LeetCode之Insert Interval(Kotlin)LeetCodeKotlin
- 精度(precision),召回率(recall),map
- 巧妙設定job的interval
- High precision grasp pose detection in dense clutter
- oracle interval日期函式的bug!Oracle函式
- 如何實現一個Interval HookHook
- “getfacl: Removing leading '/' from absolute path names”解決辦法REM
- [LeetCode] 57. Insert Interval 插入區間LeetCode
- HDU 2256Problem of Precision(矩陣快速冪)矩陣
- data too long for column
- oracle的interval時間格式的總結Oracle
- Precision,Recall,TPR,FPR,ROC,AUC,F1辨析
- AT_arc166_d [ARC166D] Interval Counts
- sklearn(七)計算多分類任務中每個類別precision、recall、f1的整合函式precision_recall_fscore_support()函式
- MySQL ERROR 1040: Too many connectionsMySqlError
- 解決 Too many symbol filesSymbol
- 如何在React中優雅的使用Interval(輪詢)React
- Oracle查詢Interval partition分割槽表內資料Oracle
- mysql specified key was too long與Index column size too large. The maximum column size is 767 bytes.MySqlIndex
- [20210418]ORA-14767 Cannot specify this interval with existing high bounds.txt
- Too many files with unapproved license異常APP
- Error running ‘Application’Command line is too longErrorAPP
- 效能“怪獸”:全新戴爾Precision 7875塔式工作站亮相
- 機器學習中的 precision、recall、accuracy、F1 Score機器學習
- 執行新增和修改操作報錯connection is read-only. Queries leading to data modification are not allowed
- interval 分割槽表clob預設表空間指定問題
- 計算深度學習評價指標Precision、Recall、F1深度學習指標
- ORA-01489: result of string concatenation is too long
- Too many open files報錯處理
- 著名的ORA-1555:snapshot too old
- AST is too big. Maximum: 500000 處理AST
- 分類模型的F1-score、Precision和Recall 計算過程模型
- Specified key was too long; max key length is 1000 bytes
- React報錯之Too many re-rendersReact
- Ubuntu 解決 Too many open files 問題Ubuntu
- Row size too large (> 8126)解決辦法