Reputation: 1
if pass the time in 24hrs format still i need to fetch the deatils from DB,createdTs is of Type String i have declared in my code but it is Timestamp type in DB
@Query(value="Select * from CODE_SET Where CREATED_TS >=:createdTs,To_Date('YYYY-MM-DD HH24:MI:SS')", nativeQuery=true) public List<Object[]> getCodeSetByCreatedTs(@Param(value="createdTs")String createdTs);
i tried it but getting something like:ORA-00933: SQL command not properly ended
Upvotes: 0
Views: 68
Reputation: 166
The createdTs in the query should be inside the To_Date function so that it can be converted into the appropriate format. This is probably why you are getting the error.
You can try to change your query to something like this
@Query(value="Select * from CODE_SET Where CREATED_TS>=To_Date(:createdTs,'YYYY-MM-DD HH24:MI:SS')", nativeQuery=true) public List<Object[]> getCodeSetByCreatedTs(@Param(value="createdTs")String createdTs);
Upvotes: 0