# Sql inner join

**URL:** <https://forum.inductiveautomation.com/t/sql-inner-join/11075>\
**Category:** Ignition\
**Created:** [January 20, 2016, 5:49pm UTC](https://forum.inductiveautomation.com/t/sql-inner-join/11075 "2016-01-20T17:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boster281](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@boster281](https://forum.inductiveautomation.com/u/boster281)\
**Post date:** [January 20, 2016, 5:49pm UTC](https://forum.inductiveautomation.com/t/sql-inner-join/11075/1 "2016-01-20T17:49:26Z")

</div>

I want to run the following sql query on the push of a button but I am not sure how to do it with Component Scripting.

`
update 
	Thermoplastics.dbo.FinishingResults
set 
	Thermoplastics.dbo.FinishingResults.BushingContainer = Thermoplastics.dbo.Curelot.BushingsContainer,
	Thermoplastics.dbo.FinishingResults.AdhesiveContainer = Thermoplastics.dbo.Curelot.AdhesiveContainer,
	Thermoplastics.dbo.FinishingResults.CureLot = Thermoplastics.dbo.Curelot.CureLot
from 
	Thermoplastics.dbo.CureLot
inner join
	Thermoplastics.dbo.FinishingResults
on 
	Thermoplastics.dbo.FinishingResults.Container = [Thermoplastics].[dbo].[CureLot].Container`

---

<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:** [January 20, 2016, 5:58pm UTC](https://forum.inductiveautomation.com/t/sql-inner-join/11075/2 "2016-01-20T17:58:02Z")

</div>

> [@boster281](#):
>
> I want to run the following sql query on the push of a button but I am not sure how to do it with Component Scripting.

sql = """update  
Thermoplastics.dbo.FinishingResults  
set  
Thermoplastics.dbo.FinishingResults.BushingContainer = Thermoplastics.dbo.Curelot.BushingsContainer,  
Thermoplastics.dbo.FinishingResults.AdhesiveContainer = Thermoplastics.dbo.Curelot.AdhesiveContainer,  
Thermoplastics.dbo.FinishingResults.CureLot = Thermoplastics.dbo.Curelot.CureLot  
from  
Thermoplastics.dbo.CureLot  
inner join  
Thermoplastics.dbo.FinishingResults  
on  
Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.CureLot.Container"""  
system.db.runUpdateQuery(sql)[/code]Note that triple quotes are python's way of supplying multiline strings.
