标签:error name from acl invalid word erro ret class
(1)
select TO_CHAR(123.56,‘999.9‘) from dual; will return 123.6
select TO_NUMBER(‘123.56‘,‘999.9‘) from dual; will fail because of error "ORA-01722: invalid number"
(2)
select TO_CHAR(123.56,‘999‘) from dual; will return 124
select TO_NUMBER(123.56,‘999‘) from dual; will fail because of error "ORA-01722: invalid number"
(3)
select TO_CHAR(123.56,‘9999.99‘) from dual;will return 123.56
select TO_NUMBER(‘123.56‘,‘9999.99‘) from dual; will return 123.56
(4)
select TO_CHAR(123.56,‘9999‘) from dual; will return 124
select TO_NUMBER(‘123.56‘,‘9999‘) from dual; will fail because of error "ORA-01722: invalid number"
(5)
select TO_CHAR(123.56,‘99‘) from dual; will return ###
select TO_NUMBER(123.56,‘99‘) from dual; will fail because of error "ORA-01722: invalid number"
(6)
select TO_CHAR(123.56,‘999.99‘) from dual; will return 123.56
select TO_NUMBER(123.56,‘999.99‘) from dual; will return 123.56
Oracle SQL: TO_CHAR and TO_NUMBER 笔记
标签:error name from acl invalid word erro ret class
原文地址:http://www.cnblogs.com/hyq0002013/p/6051408.html