cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to invoke athena query editor from a thingworx service?

chaitanya
7-Bedrock

How to invoke athena query editor from a thingworx service?

I am able to connect to athena with jdbc extension. I created a service including sql query which I want to run on athena.
Whenever I try to invoke the service, I am able to see the service hit in athena history with a failed log as follows,
/////
2018-04-23 14:06:15.052+0530 [L: ERROR] [O: c.t.w.BaseService] [I: ] [U: user] [S: ] [T: https-jsse-nio-8443-exec-3] [context: com.thingworx.webservices.context.HttpExecutionContext@4e2d91c9][message: Unable to Invoke Service hitAthena on athenaNew : Execute Update failed: java.sql.SQLException: [Simba][AthenaJDBC](100071) An error has been thrown from the AWS Athena client. Only one sql statement is allowed. Got: SELECT * FROM (select * from "data"."table";) T LIMIT 0]
/////

4 REPLIES 4
supandey
19-Tanzanite
(To:chaitanya)

Hi @chaitanya could you please share your sql statement here?

sHi @supandey,

My Sql statement is "select * from "databaseName"."tableName";

 

Please find attached configuration  screenshot for thing created with imported jdbc extension

supandey
19-Tanzanite
(To:chaitanya)

@chaitanya are you attempting to execute that statement with quotation marks? I don't think you'll need that. BTW what kind of query handler are you using for select statement?

supandey
19-Tanzanite
(To:chaitanya)

@chaitanya are you attempting to execute that statement with quotation marks? I don't think you'll need that. BTW what kind of query handler are you using for select statement?

Top Tags