# Power Table onCellEdited - SQL table column data type issue

**URL:** <https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 21, 2022, 3:01pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415 "2022-03-21T15:01:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 21, 2022, 3:01pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/1 "2022-03-21T15:01:00Z")

</div>

Hi, I have found that when the data type of a SQL Server 2014 PK column ‘ndx’ is set to INT, the power table scripts work fine but if I change the column to BIGINT, then the power table scripts do not work.  
Is there a work around for this?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/372d5bd908f95031607a3b730d963c91d3aa591a.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/4/94629b12f6789c7fb2cfc49b87db2e5fa444f54e.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Au](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_au/32/32944_2.png) [@Brandon\_Au](https://forum.inductiveautomation.com/u/Brandon_Au)\
**Post date:** [March 21, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/2 "2022-03-21T16:28:24Z")

</div>

Are you getting any kind of popup errors or errors in your logs when you try to use BIGINT? Can you share a screenshot of those potential errors?

Also, what version of Ignition are you using (including minor revision)?

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [March 21, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/3 "2022-03-21T18:14:58Z")

</div>

I think the log errors will say for sure but also curious if it could be just a data type mapping issue.

The [JDBC driver](https://docs.inductiveautomation.com/display/DOC81/JDBC+Drivers+and+Translators) default settings in the manual show:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96e67095b121c23c85c60e2f3d721d98196dda90.png)

That makes me think it needs to be sent as a long, if the value is small enough in your table I could see it defaulting to an int. Can you force it to a long before sending it as your argument to see if it does anything? I’m sure @Brandon_Au can tell me if I’m way off. I’m saying this without having a database in front of me to test it on right now.

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 11:08am UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/4 "2022-03-22T11:08:14Z")

</div>

Hi, thank you for responding. I am using 7.9.12.  
I ran a test just now and as soon as I changed the DB table PK to bigint, the script stopped working or at least the check boxes would no longer accept user input. They would change highlighted color but would not let me check/uncheck. Once I put the PK back to int, everything worked fine…  
I could not see any obvious errors in the log (see attached pic).

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f454e7258ba46d8ec14ce1fb87a1c76483b3f456.png)

 ![int vs big int](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3688d88d38fe71f90f7b2b7d4814601ac13d769b.jpeg)

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 11:11am UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/5 "2022-03-22T11:11:07Z")

</div>

Thank you for responding. I don’t know how to modify how the power table sends data to the SQL server. I just point it to the database and any modifications made for long / int are done within the database itself…  
(I am signed up for a Inductive Automation full week course in May, so hope to get a lot better at this!)

---

<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:** [March 22, 2022, 11:40am UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/6 "2022-03-22T11:40:05Z")

</div>

You might need to update your JDBC driver. Some versions didn’t handle java `BigInteger` to DB `bigint` properly. (Jython `long` is java `BigInteger`, not java `Long`.)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 22, 2022, 11:43am UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/7 "2022-03-22T11:43:38Z")

</div>

To try what @bpreston is suggesting try changing `args = [newValue, key]` to `args = [newValue, long(key)]`

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 12:24pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/8 "2022-03-22T12:24:14Z")

</div>

Thank you I just now verified that Java is up to date…

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/5486c7f16fd0e9dae265fe1127547dbbd4de4849.png)

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 1:06pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/9 "2022-03-22T13:06:34Z")

</div>

Thank you, are you suggesting I pass some arguments from within the power table query?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/a/8a2deaf0a6dbca5ffacd1ba874d6e8fbc7de7155.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 22, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/10 "2022-03-22T13:10:51Z")

</div>

No, I’m suggesting changing your `onCellEdited` Extension function from:

```python
key = self.data.getValueAt(rowIndex, 'ndx')
args = [newValue,key]
query = 'UPDATE tbl_MMS_Exclued SET %s = ? WHERE ndx = ?' % (colName)
system.db.runPrepUpdate(query,args)
system.db.refresh(self,'data')

```

to something like:

```python
key = self.data.getValueAt(rowIndex, 'ndx')
args = [newValue,long(key)]
query = 'UPDATE tbl_MMS_Exclued SET %s = ? WHERE ndx = ?' % (colName)
system.db.runPrepUpdate(query,args)
system.db.refresh(self,'data')

```

---

<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:** [March 22, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/11 "2022-03-22T13:30:27Z")

</div>

I wasn’t referring to the java version. The JDBC driver is from Microsoft, and needs to be selected to match your DB and java platform (JRE 8). See this Microsoft compatibility matrix:

> **[Support matrix - JDBC Driver for SQL Server](https://docs.microsoft.com/en-us/sql/connect/jdbc/microsoft-jdbc-driver-for-sql-server-support-matrix?view=sql-server-ver15)**
>
> This page contains the support matrix and support life-cycle policy for the Microsoft JDBC Driver for SQL Server.

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 2:19pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/12 "2022-03-22T14:19:10Z")

</div>

> [@pturmel](#):
>
> BigInteger

Ah, my bad!  
I tried both 'long' and 'biginteger' but neither worked with the PK set to biginteger  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8d937d013cd380705fb7bd07a0dc35f6caa31635.png)

Thank you regardless

---

<div class="post-metadata">

**Author:** ![Richard\_Tryon](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Richard\_Tryon](https://forum.inductiveautomation.com/u/Richard_Tryon)\
**Post date:** [March 22, 2022, 2:20pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-sql-table-column-data-type-issue/57415/13 "2022-03-22T14:20:18Z")

</div>

I am currently investigating the compatibility matrix, thank you very much
