# Single query to set multiple tags

**URL:** <https://forum.inductiveautomation.com/t/single-query-to-set-multiple-tags/7667>\
**Category:** Ignition\
**Created:** [December 4, 2013, 4:17pm UTC](https://forum.inductiveautomation.com/t/single-query-to-set-multiple-tags/7667 "2013-12-04T16:17:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [December 4, 2013, 4:17pm UTC](https://forum.inductiveautomation.com/t/single-query-to-set-multiple-tags/7667/1 "2013-12-04T16:17:26Z")

</div>

This small script query’s a stored procedure, and sets a flag. I want to run this query on tags ST15:1 through ST15:26. For some reason my brain is failing me today…

I Tried a for x in range (1,26) but I cannot figure out how to put x in the tag path. Can someone point me in the right direction? Thanks

scanRead = system.tag.read(“_AHSK\_Conveyor_/ST15/ST15:5”).value  
call = system.db.createSProcCall(“spWorkOrderHTapeFlag”,“JDEX”)  
call.registerReturnParam(system.db.VARCHAR)  
call.registerInParam(1, system.db.VARCHAR, scanRead)  
system.db.execSProcCall(call)

### Write tag results to HTape Tag###

tapeValue = call.getReturnValue()  
system.tag.write(“Lane/Lane5HTape”,tapeValue)

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [December 4, 2013, 4:49pm UTC](https://forum.inductiveautomation.com/t/single-query-to-set-multiple-tags/7667/2 "2013-12-04T16:49:58Z")

</div>

`for x in range (1,26):
   scanRead = system.tag.read("_AHSK_Conveyor_/ST15/ST15:" + str(x)).value`

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [December 4, 2013, 8:45pm UTC](https://forum.inductiveautomation.com/t/single-query-to-set-multiple-tags/7667/3 "2013-12-04T20:45:38Z")

</div>

You should probably use `range(1,27)` to be sure.
