java.sql.SQLException:ORA-00933:SQL命令未正确结束

时间:2016-05-28 11:20:21

标签: java

SELECT SUBSTR(MESG,98,15) AS ACC,FROM TBAADM.RTT WHERE CUST_OR_CARD_ID= "+No+"'" +
                   "AND TO_DATE(TO_CHAR(SYSTEM_DATE_TIME,'MM-DD-YY'))= "+tranDate+"'" +
                   "AND TO_NUMBER(SNO)=' "+sno+"'" +
                   "AND DCC_ID='SWT' AND CMD='PRCR' AND BANK_ID='PMC01' ";

1 个答案:

答案 0 :(得分:0)

你在某些地方有额外的报价,或者在其他地方错过了一些。并且应在From之前删除额外的逗号。

"SELECT SUBSTR(MESG,98,15) AS ACC FROM TBAADM.RTT WHERE CUST_OR_CARD_ID= '"+No+"' " +
                   "AND TO_DATE(TO_CHAR(SYSTEM_DATE_TIME,'MM-DD-YY'))= '"+tranDate+"' " +
                   "AND TO_NUMBER(SNO)= "+sno+" " +
                   "AND DCC_ID='SWT' AND CMD='PRCR' AND BANK_ID='PMC01' ";