![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
By troubleshooting the query, I confirm the culprits are the two columns DAILYDOWNLOADSIZE and DAILYDOWNLOADTIME. Both must be casted from character(15) to bigint. What is the second SQL statement not working??? |
#3
| |||
| |||
|
|
[Running DB2 UDB version 9] Why does this SQL statement work 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 ...when this one does not 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 I get an error SQL0420N Invalid character found in a character string argument of the function "BIGINT". SQLSTATE=22018. By troubleshooting the query, I confirm the culprits are the two columns DAILYDOWNLOADSIZE and DAILYDOWNLOADTIME. Both must be casted from character(15) to bigint. What is the second SQL statement not working??? |
#4
| |||
| |||
|
|
select DAILYDOWNLOADSIZE, DAILYDOWNLOADTIME from EDMPROD.MQT_STB_FACTS where castalesce_bigint(DAILYDOWNLOADSIZE) is null or castalesce_bigint(DAILYDOWNLOADTIME) is null |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |