2

When i excuting below query showing org.hibernate.hql.ast.QuerySyntaxException: unexpected token: AGAINST near line 1, column 106 [SELECT NAME,address,country,district,state,cpr_no,age FROM tbl_patient_general WHERE MATCH (NAME,cpr_no) AGAINST (:params)]

            Query q3 = session.createQuery("SELECT NAME,address,country,district,state,cpr_no,age FROM tbl_patient_general WHERE MATCH (NAME,cpr_no) AGAINST (:params)");
            q3.setParameter("params", name);
3
  • Just try by removing WHERE clause. Commented Aug 5, 2013 at 12:31
  • Still it's not working.. Commented Aug 5, 2013 at 12:35
  • I guess the table name is wrong!! what is the beans/hibernate-pojo's name ? Commented Aug 5, 2013 at 18:45

1 Answer 1

1

Are you using native SQL or HQL? In first case use session.createSQLQuery().
AGAINST is not an HQL function/reserved word

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.