SQL date format bind variable -
Can someone please tell me what is wrong with this SQL query? Select
USERNAME, CallerID from DateCreated, CREDTYPE, USAGETYPE, OPERATIONID, TXNID, arwfissuanceauditlog where in OPERATIONID (2104,2107) and DateCreated & gt; = 'TO_DATE (' 2010/06/21 ',' yyyy / MM / dd HH24: MI: SS ')' and Detrett & Lt; 'TO_DATE (' 2010/08/03 ',' yyyy / MM / dd HH24: MI: SS ')'
When I ran into SQL Developer I got this message <
unknown command bind variable "MI" has not been declared
I am speaking from Java like this
Try {stmt = conn.createStatement (); Results = stmt.executeQuery (queryToExecute); } Hold (SQLException e) {CredChangeReportSVC.DEFAULTLOGGER.error ("Exception occurred when executing query:" + queryToExecute, e); }
I received this message in the log
Error 03 August 2010 14: 51: - 06, 939 query while executing an exception: "USERNAME's selection CallerID to OPERATIONID (2104,2107) and DateCreated & gt; = 'TO_DATE (' 2010/06/21 ',' yyyy / MM / dd HH24: MI: DateCreated, CREDTYPE, USAGETYPE, OPERATIONID, TXWID, 'arwfissuanceauditlog' SS ')' and 'DateCreated & lt;' TO_DATE ('08/08/03, '' yyyy / MM / dd HH24: MI: SS ') "java.sql.SQLException: Invalid SQL type
Thanks in advance. /p>
Your date format specifies a time portion, but you define it by your datetime string "HH24" : MI: SS "Drop and try again
Comments
Post a Comment