# 'Join' data from different database connections

**URL:** <https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924>\
**Category:** Ignition\
**Created:** [July 13, 2016, 11:31am UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924 "2016-07-13T11:31:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bart\_AT-Automation](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bart\_AT-Automation](https://forum.inductiveautomation.com/u/Bart_AT-Automation)\
**Post date:** [July 13, 2016, 11:31am UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924/1 "2016-07-13T11:31:58Z")

</div>

Hi,

Currently I am working on a project with two different databases.  
The first database is from a ERP system.  
The second database is for Ignition.  
In the ERP database, a articlecode, articles names and descriptions are stored.  
In the Ignition database production information is stored which is refered trough the articlecode.

Now I would like to show the production information and the article information together in 1 table on the screen. However it is only possible to choose one datasource with a sql binding.

Is it possible to ‘Join’ the two tables and show them together in one table?  
And how would this be the fastest solution?

Best Regards,  
Bart Mans

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 13, 2016, 1:44pm UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924/2 "2016-07-13T13:44:22Z")

</div>

There’s no way to join across datasources in Ignition – there’s no such capability in the underlying JDBC technology that Ignition uses. You’d need to query from one then the other, programmatically joining the two and manually constructing a result dataset. It’s something I’ve toyed with as an improvement to the view() function of [Simulation Aids](http://marketplace.inductiveautomation.com/moduledetail?moduleId=93), but doing it in a suitably general way is daunting.

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [July 14, 2016, 1:13am UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924/3 "2016-07-14T01:13:33Z")

</div>

seems like something you could do in a stored procedure in sql. then call the stored procedure in igntiion.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 14, 2016, 9:35am UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924/4 "2016-07-14T09:35:22Z")

</div>

[quote=“diat150”]seems like something you could do in a stored procedure in sql. then call the stored procedure in igntiion.[/quote]Not under the constraints Bart describes. Now, if you used the features of one of the databases to make a foreign data connection to the other, indirectly importing the data, you could do the join entirely in that database. But then a regular query would work, without needing any stored procedure. Support for foreign data connections varies widely amongst the various database platforms, especially when connecting to a different platform. Bart didn’t provide that detail.

---

<div class="post-metadata">

**Author:** ![Bart\_AT-Automation](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bart\_AT-Automation](https://forum.inductiveautomation.com/u/Bart_AT-Automation)\
**Post date:** [August 2, 2016, 9:45am UTC](https://forum.inductiveautomation.com/t/join-data-from-different-database-connections/11924/5 "2016-08-02T09:45:38Z")

</div>

I have tried to put the query in a stored procedure. This works fine. Thanks for the help!
