# Sql query The multi-part identifier could not be bound

**URL:** <https://forum.inductiveautomation.com/t/sql-query-the-multi-part-identifier-could-not-be-bound/11335>\
**Category:** Ignition\
**Created:** [March 9, 2016, 2:00pm UTC](https://forum.inductiveautomation.com/t/sql-query-the-multi-part-identifier-could-not-be-bound/11335 "2016-03-09T14:00:05Z")\
**Posts on this page:** 1\
**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:** [March 9, 2016, 2:00pm UTC](https://forum.inductiveautomation.com/t/sql-query-the-multi-part-identifier-could-not-be-bound/11335/1 "2016-03-09T14:00:05Z")

</div>

The error message i am getting:

File “event:mousePressed”, line 43, in

```
	   Thermoplastics.dbo.PartTracking

		set

	   Thermoplastics.dbo.PartTracking = 97

		from

	   Thermoplastics.dbo.PartTracking

		inner join

	   Thermoplastics.dbo.FinishingResults

		on

	   Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.PartTracking.Container

	   where Thermoplastics.dbo.FinishingResults.CureLot = 160309072124, , , false)

```

java.lang.Exception: java.lang.Exception: Error executing system.db.runUpdateQuery(update

```
	   Thermoplastics.dbo.PartTracking

		set

	   Thermoplastics.dbo.PartTracking = 97

		from

	   Thermoplastics.dbo.PartTracking

		inner join

	   Thermoplastics.dbo.FinishingResults

		on

	   Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.PartTracking.Container

	   where Thermoplastics.dbo.FinishingResults.CureLot = 160309072124, , , false)

caused by Exception: Error executing system.db.runUpdateQuery(update
	   Thermoplastics.dbo.PartTracking
		set
	   Thermoplastics.dbo.PartTracking = 97
		from
	   Thermoplastics.dbo.PartTracking
		inner join
	   Thermoplastics.dbo.FinishingResults
		on
	   Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.PartTracking.Container
	   where Thermoplastics.dbo.FinishingResults.CureLot = 160309072124, , , false)
caused by GatewayException: SQL error for "update
	   Thermoplastics.dbo.PartTracking
		set
	   Thermoplastics.dbo.PartTracking = 97
		from
	   Thermoplastics.dbo.PartTracking
		inner join
	   Thermoplastics.dbo.FinishingResults
		on
	   Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.PartTracking.Container
	   where Thermoplastics.dbo.FinishingResults.CureLot = 160309072124": The multi-part identifier "Thermoplastics.dbo.PartTracking" could not be bound.
caused by SQLServerException: The multi-part identifier "Thermoplastics.dbo.PartTracking" could not be bound.

```

Based off this code

[code]import time  
qv1 = event.source.parent.getComponent(‘Label 15’).text  
qv2 = system.tag.read(“Finishing/OP97/CureLot”)

if system.gui.confirm(u’Are you sure?’, ‘Confirm’):  
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)

```
#time.sleep(1)

sql1 = """delete from

```

Thermoplastics.dbo.Curelot  
where  
CureLot = (%s)""" %(qv1)  
system.db.runUpdateQuery(sql1)

```
sql2 = """update
	   Thermoplastics.dbo.PartTracking
		set
	   Thermoplastics.dbo.PartTracking = 97
		from
	   Thermoplastics.dbo.PartTracking
		inner join
	   Thermoplastics.dbo.FinishingResults
		on
	   Thermoplastics.dbo.FinishingResults.Container = Thermoplastics.dbo.PartTracking.Container
	   where Thermoplastics.dbo.FinishingResults.CureLot = """+qv1+""""""
system.db.runUpdateQuery(sql2)[/code]
```
