Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
How to show the SQL query result in LED display or Value display widget?
Solved! Go to Solution.
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
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.
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.
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
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.
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
Thanks for your support Ankit, Its working now.
Hi Guru Vignesh, Great! Could you please mark the answer as correct so that this Thread is closed and other member know that this Thread has a Solution.
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
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'?
yeah!! I am getting this error on clicking the button - 'create datashape from result'
Bavithraa Marimuthu, Are you receiving any related error in Application logs. Are you using Administrator user to create datashape from result.
Does the result column has any special character?
I tried displaying my result using SQL Alias. Now it works fine.
Thanks Ankit!!