# How can i change a bit from ignition to SQL server

**URL:** <https://forum.inductiveautomation.com/t/how-can-i-change-a-bit-from-ignition-to-sql-server/79225>\
**Category:** Ignition\
**Tags:** scripting, ignition79\
**Created:** [September 15, 2023, 4:09pm UTC](https://forum.inductiveautomation.com/t/how-can-i-change-a-bit-from-ignition-to-sql-server/79225 "2023-09-15T16:09:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Medrano](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sebastian\_Medrano](https://forum.inductiveautomation.com/u/Sebastian_Medrano)\
**Post date:** [September 15, 2023, 4:09pm UTC](https://forum.inductiveautomation.com/t/how-can-i-change-a-bit-from-ignition-to-sql-server/79225/1 "2023-09-15T16:09:21Z")

</div>

Im trying to edite a cell with booleans in a power table and change the data in the database this is my script in the extension functions of onCellEdited:  
Row = self.data.getValueAt(rowIndex, 'Row')  
query = "UPDATE Actividades SET %s = ? WHERE Row = ?" % (colName)  
args = [bool(newValue), Row]  
system.db.runPrepUpdate(query, args)  
system.db.refresh(self, "data")  
and this is the issue:

 ![iss3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/627d7e6350359d6cf30b01632ca7bc35375a9efb.png)  
 ![iss2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c8d0d6a821b261fb40bd050b0a3e9096ad7553a.png)  
 ![iss](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/27a083bca9e38f8c1ea2ea31e0aa92fcbe030911.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 15, 2023, 4:22pm UTC](https://forum.inductiveautomation.com/t/how-can-i-change-a-bit-from-ignition-to-sql-server/79225/2 "2023-09-15T16:22:50Z")

</div>

The line you're looking for is,

```auto
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: 
    SQL error for UPDATE Actividades.Machine_ledger SET Check = ? WHERE Row = ?": 
    Incorrect syntax near the keyword 'Check'.

```

(I had to use OCR to extract the error message so there may be errors in it. Tip: post text - not pictures of errors or code. When posting code format it properly. See link below.)

It looks like you are expecting a column 'Check' but the database doesn't have one.

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code]
