oracle ORA-01722 報錯 "invalid number"
今天寫的SQL報錯,報錯資訊是 ORA-01722 "invalid number"
select /*+parallel(l 5)*/
e.customcode "賬戶內碼",
e.customphone "手機號碼",
sum(l.betamount) / 100 "投注金額(元)",
min(l.transdate) "投注時間",
l.ticketcode "票號"
from ELMP_REPORT_SALEDETAIL l,
ELMP_REPORT_CUSTOMACCOUNTFLOW w,
ELMP_REPORT_CUSTOMDETAIL e
where l.clientflownum = w.transflowid
and w.customcode = e.customcode
and TO_CHAR(TRANSDATE, 'YYYYMMDD') = '&1'
and w.customtransdate >= to_date('&1', 'YYYYMMDD') - 1
and w.customtransdate < to_date('&1', 'YYYYMMDD') + 2
and substr(l.ticketcode, -3) = '111'
group by l.ticketcode, e.customcode, e.customphone
order by l.ticketcode, min(l.transdate);
仔細檢查後,發現原來是關聯的欄位的資料型別不一致,一個是number型別,一個是varchar2型別
需要轉換資料型別,更改後的SQL如下
select /*+parallel(l 5)*/
e.customcode "賬戶內碼",
e.customphone "手機號碼",
sum(l.betamount) / 100 "投注金額(元)",
min(l.transdate) "投注時間",
l.ticketcode "票號"
from ELMP_REPORT_SALEDETAIL l,
ELMP_REPORT_CUSTOMACCOUNTFLOW w,
ELMP_REPORT_CUSTOMDETAIL e
where l.clientflownum = to_char(w.transflowid)
and w.customcode = e.customcode
and TO_CHAR(TRANSDATE, 'YYYYMMDD') = '&1'
and w.customtransdate >= to_date('&1', 'YYYYMMDD') - 1
and w.customtransdate < to_date('&1', 'YYYYMMDD') + 2
and substr(l.ticketcode, -3) = '111'
group by l.ticketcode, e.customcode, e.customphone
order by l.ticketcode, min(l.transdate);
select /*+parallel(l 5)*/
e.customcode "賬戶內碼",
e.customphone "手機號碼",
sum(l.betamount) / 100 "投注金額(元)",
min(l.transdate) "投注時間",
l.ticketcode "票號"
from ELMP_REPORT_SALEDETAIL l,
ELMP_REPORT_CUSTOMACCOUNTFLOW w,
ELMP_REPORT_CUSTOMDETAIL e
where l.clientflownum = w.transflowid
and w.customcode = e.customcode
and TO_CHAR(TRANSDATE, 'YYYYMMDD') = '&1'
and w.customtransdate >= to_date('&1', 'YYYYMMDD') - 1
and w.customtransdate < to_date('&1', 'YYYYMMDD') + 2
and substr(l.ticketcode, -3) = '111'
group by l.ticketcode, e.customcode, e.customphone
order by l.ticketcode, min(l.transdate);
仔細檢查後,發現原來是關聯的欄位的資料型別不一致,一個是number型別,一個是varchar2型別
需要轉換資料型別,更改後的SQL如下
select /*+parallel(l 5)*/
e.customcode "賬戶內碼",
e.customphone "手機號碼",
sum(l.betamount) / 100 "投注金額(元)",
min(l.transdate) "投注時間",
l.ticketcode "票號"
from ELMP_REPORT_SALEDETAIL l,
ELMP_REPORT_CUSTOMACCOUNTFLOW w,
ELMP_REPORT_CUSTOMDETAIL e
where l.clientflownum = to_char(w.transflowid)
and w.customcode = e.customcode
and TO_CHAR(TRANSDATE, 'YYYYMMDD') = '&1'
and w.customtransdate >= to_date('&1', 'YYYYMMDD') - 1
and w.customtransdate < to_date('&1', 'YYYYMMDD') + 2
and substr(l.ticketcode, -3) = '111'
group by l.ticketcode, e.customcode, e.customphone
order by l.ticketcode, min(l.transdate);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1819169/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sqlldr 時碰到錯誤 ORA-01722: invalid numberSQL
- 隱式轉換錯誤:ORA-01722: invalid number
- SQLLoader ORA-01722 invalid numberSQL
- 【問題處理】ORA-01722: invalid number
- ORA-01722:invalid number-解決GAT專案中車輛維修Bug(續)
- ERROR 1292 (22007): Truncated incorrect DOUBLE value 和ORA-01722: invalid numberError
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- mongodb報錯:the limit must be specified as a number。MongoDBMIT
- iOS 上架報錯 This bundle is invalid 或 Invalid Image PathiOS
- React報錯之Element type is invalidReact
- mybatis 報錯: Invalid bound statement (not found)MyBatis
- Django報錯ValueError: invalid literal for int() with base 10:DjangoError
- Java - XML字元支援報錯An invalid XML characterJavaXML字元
- Oracle12c叢集啟動時提示%CRS_LIMIT_OPENFILE%: invalid numberOracleMIT
- python: invalid value encountered in divide以及invalid value encountered in double_scalars報錯PythonIDE
- MySQL過程報 Parameter number N is not an OUT parameter錯誤MySql
- Elasticsearch 6 建立索引報錯 invalid_index_name_exception Invalid index name [testDemo], must be lowercaseElasticsearch索引IndexException
- Oracle 11g使用MERGE報錯'ORA-02287..The specified sequence number (CURRVAL'Oracle
- Unable to unwrap data, invalid status [CLOSED]-服務端webSocket報錯服務端Web
- Mingw GCC 編譯OpenCV報錯: Project files may be invalidGC編譯OpenCVProject
- `jsonb` 報錯 `invalid input syntax for type timestamp with time zone ““JSON
- oracle dg報錯Oracle
- oracle emctl 報錯Oracle
- Oracle-ORA-01722:invalid number-解決GAT專案中車輛維修BugOracle
- Python 連線 Minio 報錯:[SSL: WRONG_VERSION_NUMBER]Python
- nginx: [error] invalid PID number "" in "/var/run/nginx.pid"NginxError
- 華為支付購買token的verify介面報錯Token is expired or invalid
- Maven專案報錯invalid LOC header (bad signature)MavenHeader
- Oracle System Change Number (SCN) Number 完全筆記Oracle筆記
- Oracle TNS報錯大全Oracle
- 連線oracle報錯Oracle
- 一個sql查詢語句報ORA-01722SQL
- err Invalid input of type: 'dict'. Convert to a byte, string or number first
- MySQL 5.7 Invalid default value for 'CREATE_TIME'報錯的解決方法MySql
- MybatisPlus自帶方法報錯BindingException: Invalid bound statement (not found)MyBatisException
- 【Azure Service Bus】建立 ServiceBus 的Terraform指令碼報錯GetAuthorizationRule: Invalid inputORM指令碼
- 【NUMBER】Oracle的NUMBER資料型別特點Oracle資料型別
- linux解壓報錯gzip: stdin: invalid compressed data--format violatedLinuxORM