Reputation: 21
ResultSet resultObj = statementObj.executeQuery("SELECT EMPLOYEE_ID FROM JOB_HISTORY WHERE START_DATE > Convert(datetime, '2001-01-13' )");
I get this error while Iam executing the program:
java.sql.SQLSyntaxErrorException: ORA-00904: "DATETIME": invalid identifier
Upvotes: 1
Views: 472
Reputation: 517
try this
Query ="SELECT EMPLOYEE_ID FROM JOB_HISTORY WHERE START_DATE >'2001-01-13' ";
ResultSet resultObj = statementObj.executeQuery(Query);
Upvotes: 0
Reputation: 1269443
If you are using Oracle, use Oracle syntax:
SELECT EMPLOYEE_ID
FROM JOB_HISTORY
WHERE START_DATE > DATE '2001-01-13';
The date
keyword allows you to use ISO-standard syntax for date constants.
Upvotes: 2
Reputation: 13222
Try this:
ResultSet resultObj = statementObj.executeQuery("SELECT EMPLOYEE_ID FROM JOB_HISTORY WHERE START_DATE > '2001-01-13'");
Upvotes: 0