Skip to main content
1-Visitor
December 16, 2016
Solved

How to show the SQL query result in LED display or Value display widget?

  • December 16, 2016
  • 3 replies
  • 7087 views

How to show the SQL query result in LED display or Value display widget?

Best answer by ankigupta

Hi Guru Vignesh​,

I just checked it on my local instance and it seems that the default output of Sql query is an infotable.

Try following:

In the service; set the Max rows as 1 and set the output type as infotable. Create a DataShape for the infotable output and set it in the Output.

In the mashup keep everything same. But you would need to rebind the data.

Its working on my instance.

Do let me know in case you face any issue.

Thanks,

Ankit Gupta

3 replies

22-Sapphire I
December 16, 2016

Either return the full infotable and grab the value by expanding Data and then dragging the correct field to the Widget

or wrap the SQL service call with another service that grabs just the value you need (sqlqueryresult.valueiwant) and returns that as a number.

gvignesh1-VisitorAuthor
1-Visitor
December 26, 2016

Hi Chung, I have tried the first method and i am not able to bind the data from sql service to LED widget. Is there any other way to bind the data from sql service.

Please share some reference or documentation if any.

5-Regular Member
December 27, 2016

Hi Guru Vignesh​, What issue are you facing while binding the output data from Sql query service to LED Display. Can you please share more details.

If the output of your Sql query is integer/number you should be able to directly bind your data to LED Display.

If you are receiving data as Infotable; either create a new sql query to pull just the single integer/number or create a java service to filter data from the sql query to get single integer/number. Then you can use this output to bind to bind to LED Display/ value Display widget.

Also, make sure you check the "mashup Loaded?" to call the service on mashup load or use some other way to call the service in the Mashup.

I hope it helps.

Thanks,

Ankit Gupta

gvignesh1-VisitorAuthor
1-Visitor
December 27, 2016

Hi Ankit Gupta, I have tried defining the query output as an Integer/Number. I am able to bind the result of query to an LED display but when i go to runtime the widget isn't showing any values. Highlighted with black box in the attached image.

I am calling the service when mashup is loaded.Runtime.pngMashup Mapping.pngQuery Result.png

ankigupta5-Regular MemberAnswer
5-Regular Member
December 27, 2016

Hi Guru Vignesh​,

I just checked it on my local instance and it seems that the default output of Sql query is an infotable.

Try following:

In the service; set the Max rows as 1 and set the output type as infotable. Create a DataShape for the infotable output and set it in the Output.

In the mashup keep everything same. But you would need to rebind the data.

Its working on my instance.

Do let me know in case you face any issue.

Thanks,

Ankit Gupta

February 7, 2017

Am also facing the same issue. But while trying to create datashape for the executed query, getting an error as

save failed, status: Internal Server Error message: Import Failed: A Valid Name Must Be Provided


5-Regular Member
February 8, 2017

Bavithraa Marimuthu​, Are you providing any name to the Datashape. Try without spaces and special characters.

Or are you getting this error on clicking the button - 'create datashape from result'?

February 8, 2017

yeah!! I am getting this error on clicking the button - 'create datashape from result'