java.sql.SQLSyntaxErrorException: ORA-01722: invalid number

1, oracle sql call if it is the following sql call report: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number error
 

String sql = "select * from cis_prd.v_cjfwh_hisense_sales_query t where t.SALE_DATE=" +sale_date;

2, into the following form can be a

 String sql = "select * from cis_prd.v_cjfwh_hisense_sales_query t where t.SALE_DATE='" +sale_date + "'";

3. The cause of the error is a mistake literally, when queried as to sale_date to query the digital

Published 27 original articles · won praise 12 · views 50000 +

Guess you like

Origin blog.csdn.net/baidu_38226233/article/details/97655312