# Compute imported csv data to MySQL

**URL:** <https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359>\
**Category:** Ignition\
**Tags:** ignition78, ignition79, ignition80, database, scripting\
**Created:** [December 9, 2020, 9:37pm UTC](https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359 "2020-12-09T21:37:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehet73190](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yehet73190/32/68157_2.png) [@yehet73190](https://forum.inductiveautomation.com/u/yehet73190)\
**Post date:** [December 9, 2020, 9:37pm UTC](https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359/1 "2020-12-09T21:37:44Z")

</div>

I’m trying to import data from csv to our mysql database, so far I have no problems with the other columns, but some of our columns are calculated

Here’s my code so far:

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

I wanted to be able to compute the data pulled from the **qty** and **cost** column so that when its inserted into the database it would be computed but I’m having an error.

Any suggestions on how I can fix this?

Thank you

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 9, 2020, 9:42pm UTC](https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359/2 "2020-12-09T21:42:12Z")

</div>

Since it’s coming from csv data, I’m going to guess that qty and cost are both strings.

---

<div class="post-metadata">

**Author:** ![yehet73190](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yehet73190/32/68157_2.png) [@yehet73190](https://forum.inductiveautomation.com/u/yehet73190)\
**Post date:** [December 9, 2020, 9:52pm UTC](https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359/3 "2020-12-09T21:52:19Z")

</div>

ah yes you’re right

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

so i would have to declare or convert those into integers then?

---

<div class="post-metadata">

**Author:** ![yehet73190](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yehet73190/32/68157_2.png) [@yehet73190](https://forum.inductiveautomation.com/u/yehet73190)\
**Post date:** [December 9, 2020, 10:16pm UTC](https://forum.inductiveautomation.com/t/compute-imported-csv-data-to-mysql/41359/4 "2020-12-09T22:16:21Z")

</div>

its working now, thank you
