Following are some variations I tried out.

   -

   String query = "SELECT * FROM " + tables.get(i) + " WHERE " +
columnName + " = " + year + ";";

   -

   String query = "SELECT * FROM " + tables.get(i) + " WHERE " +
columnName + " = '" + year + "';";

   -

   String query = tables.get(i) + " : " + "SELECT * FROM " +
tables.get(i) + " WHERE " + columnName + " = " + year + ";";

   - I tried to use a 'PreparedStatement' as well. But that requires a
   database connection.

Any help is appreciated.

On Fri, May 27, 2016 at 5:54 PM, Fathima Dilhasha <[email protected]> wrote:

> Hi,
>
> I'm trying to call "*search(int tenantId, String tableName, String query,
> int start, int count)*" in *"org.wso2.carbon.analytics.*
>
> *api.AnalyticsDataAPI".*
> The query I'm using is as follows.
>
>     String query = "SELECT * FROM " + tables.get(i) + " WHERE " +
>             columnName + " = " + year;
>
> The error is as follows.
>
>
> *[2016-05-27 17:45:45,152] ERROR
> {org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer}
> -  Error in index search: Invalid query, a term must have a
> fieldjava.lang.RuntimeException: Invalid query, a term must have a field*
>
> I did various changes to the above mentioned query and tried out. But it
> still gives the same error.
> Am I doing something wrong?
>
> Thanks.
> Dilhasha
>
> --
> Fathima Dilhasha
> *Software Engineer*
> Mobile : +94 (0) 771663314 <%2B94%20%280%29%20773655496>
> <%2B94%20%280%29%20773%20451194>
> [email protected] <[email protected]>
>



-- 
Fathima Dilhasha
*Software Engineer*
Mobile : +94 (0) 771663314 <%2B94%20%280%29%20773655496>
<%2B94%20%280%29%20773%20451194>
[email protected] <[email protected]>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to