cancel
Showing results for 
Search instead for 
Did you mean: 

Flexible Search Query in Java

former_member628401
Participant
0 Kudos

Hi All,

I Tried to write below query in Java code but its not working.

String B2B_CUSTOMERS = "select distinct {u.uid} userid, " + " replace({u.name},',',' ')name," + "{u.email}email," + " to_char(({u.lastlogin}),'mm/dd/yyyy HH24:MI:SS')last_login," + "to_char(({u.creationtime}),'mm/dd/yyyy HH24:MI:SS')creation_time," + "to_char(({u.modifiedtime}),'mm/dd/yyyy HH24:MI:SS')modified_time," + "to_char((max({o.creationtime})),'mm/dd/yyyy HH24:MI:SS') last_order_creation_date" + " from {" + "b2bcustomer as u " + "LEFT OUTER JOIN order as o ON {o.user} = {u.pk}" + "}" + "where" + "{u.active}='1' and " + "{u.creationtime} between ?startDate and ?endDate " + "group by {u.uid},{u.name},{u.email},{u.lastlogin},{u.creationtime},{u.modifiedtime}";

Can anyone suggest me why its not working and throwing below exception :

.FlexibleSearchException: SQL search error - enable the property 'flexible.search.exception.show.query.details'.

Thanks in Advance ...........

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

Marko_salonen
Contributor
0 Kudos

You should execute this query in hac and see what the error is. This error ".FlexibleSearchException: SQL search error - enable the property 'flexible.search.exception.show.query.details'." comes when the query fails but it can not log it out.

0 Kudos

what do you mean by query "fails"? Like a syntax error or something goes wrong while executing it? I am currently facing this issue. In my case I am checking a flexiblesearchquery search count > 0 before executing some INSERT_UPDATE statements from impex. I do not know why it is failing. It runs fine in hac.