# Needs to update perspective table using SQL query through scripting

**URL:** <https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 7, 2021, 12:51pm UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832 "2021-12-07T12:51:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baskar\_Arumugam](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Baskar\_Arumugam](https://forum.inductiveautomation.com/u/Baskar_Arumugam)\
**Post date:** [December 7, 2021, 12:51pm UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/1 "2021-12-07T12:51:59Z")

</div>

One customised table was designed for some functions. That table data property is bound to an SQL query so that the SQL data can be monitored in the table itself. Now I want to update the SQL data from the table by selecting the table row. I have attached the file for your reference. As per my design, once I select any row in the table, the selected row’s data will show in the text field. Once I made some changes to the existing data, I needed to press the update button to update the table data. I’m already done with the use of where conditions. But, I don’t want to use the where condition in the script. **Selected row table data wants to be updated in order to use where conditions**.

Kindly suggest the solution for this problem.

 ![Untitled](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/4/d4110bf707a92b81598a16fea342e8e9f9b8b0d1.png)

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [December 7, 2021, 12:54pm UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/2 "2021-12-07T12:54:32Z")

</div>

Welcome!

> [@Baskar\_Arumugam](#):
>
> Kindly suggest the solution for this problem.

You have CoreSim in your screenshot. Please confirm this is not part of an integrator core test. If it is, you cannot ask for help on the forum.

---

<div class="post-metadata">

**Author:** ![Baskar\_Arumugam](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Baskar\_Arumugam](https://forum.inductiveautomation.com/u/Baskar_Arumugam)\
**Post date:** [December 7, 2021, 1:00pm UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/3 "2021-12-07T13:00:54Z")

</div>

No, Its not a Core test, this is for my knowledge purpose.

---

<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:** [December 7, 2021, 1:33pm UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/4 "2021-12-07T13:33:34Z")

</div>

> [@Baskar\_Arumugam](#):
>
> But, I don’t want to use the where condition in the script.

You have to. The update button must run an UPDATE query to change the data in the database, then you can use .refreshBinding() on the table to update the display.

---

<div class="post-metadata">

**Author:** ![Baskar\_Arumugam](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Baskar\_Arumugam](https://forum.inductiveautomation.com/u/Baskar_Arumugam)\
**Post date:** [December 8, 2021, 4:01am UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/5 "2021-12-08T04:01:26Z")

</div>

Actually its updating the table data with where condition. But I don’t want to use where condition.  
For E,g. I have a four columns in a Table. I want to execute the below mentioned query  
**Update Table\_name set column\_1=‘value’,column\_2=‘value’,column\_3=‘value’,column\_4='value’**  
entire table data will be update. Because there no where condition. Am I right ?

But here same query want to execute in selected row in a table (That’s what I need)  
Any possible to execute this function in script, Please suggest me.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 8, 2021, 8:07am UTC](https://forum.inductiveautomation.com/t/needs-to-update-perspective-table-using-sql-query-through-scripting/53832/6 "2021-12-08T08:07:19Z")

</div>

> [@Baskar\_Arumugam](#):
>
> entire table data will be update.

yes

> [@Baskar\_Arumugam](#):
>
> Any possible to execute this function in script

no, you are not creating a seperate table because you selected something. What is wrong with using a where statement? xd
