Skip to main content
11-Garnet
February 9, 2026
Question

Thingworx Service fetch data from Stream and insert into DB Connector DB table in bulk.

  • February 9, 2026
  • 2 replies
  • 68 views

I have stream which have data in 11 columns, and rows have data as well as null values. I want to create a service which goal is,

  1. Fetch ~500 records from a ThingWorx Stream
  2. Insert them in a single bulk operation into Postgres using a DB Connector.
    please anyone can help me how to create this service and their logics. 

2 replies

22-Sapphire I
February 13, 2026

Not an expert by any measure. I searched a little online and it seems that a command called Copy is available in PG SQL?

So once you have the infotable you can convert that to a suitable record set to then copy into your target table?

 

16-Pearl
February 19, 2026

Hi @NJ_10144761,

It appears that there is a post that answers your question.  For the benefit of other Community Members who may have the same question, it would be great if you could designate it as the Accepted Solution.

In the event that this response did not answer your question, please post your current status so that we can continue to support.

Thanks for using the PTC Community!

Regards,

Charles

16-Pearl
March 17, 2026

I think it is possible to simply INSERT the JSON data converted from the Infotable (e.g., infotable.ToJSON()) that you retrieve from the ThingWorx Stream.
However, you would need to manually extract and restructure only the rows[] portion of the JSON to ensure that the resulting fields align correctly with your target PostgreSQL table schema.