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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Category of widget in Mashup for database query

PP_10265536
1-Newbie

Category of widget in Mashup for database query

Hi There,

Want to provide the postgreSQL database command in input and show the output , which category widget, should I using Thingworx Mashup?

Thanks in advance

1 REPLY 1

@PP_10265536 

 

Just to clarify, you want to enter a SQL query as text into a mashup and execute that query on a Postgresql database?  

If so, I would not recommend letting a user enter raw sql into a mashup to have it executed directly on a DB due to the numerous ways that somebody either maliciously or accidentally could mess up your database.  I always wrap my database services in a JavaScript service and hide the implementation from the users. 

 

With that said, if you really need to accomplish this, you'll need to:

 

1. Set up a DatabaseThing that connects to your database

2. Create a service that takes an input called myQuery (or whatever you want)

3.  The code of the service will just be:

 

<<myQuery>>

 

 

4.  In your mashup, you'll just have a Grid widget that you can show the result in.  

 

Hope that helps,

Nick

Announcements

Top Tags