Below is my query in ORACLE which is getting ORA-00917: missing comma error.
public boolean setFileDetails(String fileName,String fileType) {
String query = "insert into Filedetails_PP values (?,?,?,sysdate())";
Query qry = entityManager.createNativeQuery(query);
qry.setParameter(1, null);
qry.setParameter(2, fileName);
qry.setParameter(3, fileType);
int status=qry.executeUpdate();
if(status>0){
return true;
}else{
return false;
}
}
I don't know where it requires comma now.
Oracle's SYSDATE
is a function, but when using it in a query we don't use parentheses. Try the following query in your Java code:
String query = "insert into Filedetails_PP values (?,?,?,sysdate)";
Here is a link to the documentation for SYSDATE .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.