2
[運行DB2 UDB版本9]爲什麼這條SQL語句的工作SQLCODE:-420,SQLSTATE:22018,則sqlerrmc:BIGINT
SELECT
CASE
WHEN A.DAILYDOWNLOADSIZE is null THEN 0
else bigint(A.DAILYDOWNLOADSIZE)
END "DAILYDOWNLOADSIZE",
CASE
WHEN A.DAILYDOWNLOADTIME is null THEN 0
else bigint(A.DAILYDOWNLOADTIME)
END "DAILYDOWNLOADTIME"
FROM
EDMPROD.MQT_STB_FACTS A
...當這一個不
SELECT DISTINCT
bigint(A.CAMID) AS "CAMID",
bigint(A.RID) AS "RID",
A.SOFTWAREVERSION,
A.MODELNUMBER,
A.MANUFACTURERID,
A.MODDATE,
A.POSTTIME,
A.DELIVERYMETHOD,
bigint(A.UPTIME) AS "UPTIME",
bigint(A.NUMBEROFRESETSSINCELASTSWDL) AS "NUMBEROFRESETSSINCELASTSWDL",
bigint(A.NUMBEROFSEARCHSIGNALOSDTUNER1) AS "NUMBEROFSEARCHSIGNALOSDTUNER1",
bigint(A.NUMBEROFSEARCHSIGNALOSDTUNER2) AS "NUMBEROFSEARCHSIGNALOSDTUNER2",
bigint(A.NUMBEROFUSERDISKREFORMATS) AS "NUMBEROFUSERDISKREFORMATS",
bigint(A.NUMBEROFSYSTEMDISKREFORMATS) AS "NUMBEROFSYSTEMDISKREFORMATS",
bigint(A.NUMBEROFRECOVEREDDISKERRORS) AS "NUMBEROFRECOVEREDDISKERRORS",
IPINFO,
CASE
WHEN A.DAILYDOWNLOADSIZE is null THEN 0
else bigint(A.DAILYDOWNLOADSIZE)
END "DAILYDOWNLOADSIZE",
CASE
WHEN A.DAILYDOWNLOADTIME is null THEN 0
else bigint(A.DAILYDOWNLOADTIME)
END "DAILYDOWNLOADTIME",
bigint(A.TOTALNUMBEROFDOWNLOADSSTARTED) AS "TOTALNUMBEROFDOWNLOADSSTARTED",
bigint(A.TOTALNUMOFCOMPLETEDDLS) AS "TOTALNUMOFCOMPLETEDDLS",
CURRENT_DATE AS "LOAD_DATE"
FROM
EDMPROD.MQT_STB_FACTS A
出現錯誤SQL0420N在 函數「BIGINT」的字符串參數中找到無效字符。 SQLSTATE = 22018。
通過疑難解答查詢,我確認罪魁禍首是兩列DAILYDOWNLOADSIZE和DAILYDOWNLOADTIME。兩者都必須從角色(15)鑄造到bigint。
什麼是第二個SQL語句不工作???
這不是一個優雅的解決方案。我有同樣的問題,我無法修復它。你有沒有找到另一種方式? – deltascience 2015-03-12 14:12:04
在數據庫中使用適當的數據類型是我認爲優雅的,所以我們不得不不同意這一點。使用適當的數據類型是一種好的做法。 – 2017-07-20 13:05:06