# Get dataset row into namedquery to make a tuple duplicate, typed error

**URL:** <https://forum.inductiveautomation.com/t/get-dataset-row-into-namedquery-to-make-a-tuple-duplicate-typed-error/23820>\
**Category:** General Discussion\
**Tags:** namedqueries\
**Created:** [April 3, 2019, 5:07pm UTC](https://forum.inductiveautomation.com/t/get-dataset-row-into-namedquery-to-make-a-tuple-duplicate-typed-error/23820 "2019-04-03T17:07:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.pablo.arguello](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@jose.pablo.arguello](https://forum.inductiveautomation.com/u/jose.pablo.arguello)\
**Post date:** [April 3, 2019, 5:07pm UTC](https://forum.inductiveautomation.com/t/get-dataset-row-into-namedquery-to-make-a-tuple-duplicate-typed-error/23820/1 "2019-04-03T17:07:27Z")

</div>

Hello.  
I get error: TypeError: cannot concatenate ‘str’ and ‘int’ objects

Im trying to place an insert in a database, using a existing dataset row, like this:

dataset=system.db.runQuery(“SELECT \* FROM lista\_de\_pedido where lista\_de\_pedido\_ndx = %d” %(lista\_de\_pedido\_ndx),“Database”)

system.db.runNamedQuery(“insert\_orden”,  
{“ano\_LPER” :dataset.getValueAt(0, “ano\_LPER”),  
“Aleacion” :dataset.getValueAt(0, “Aleacion”),  
“Bocas” :dataset.getValueAt(0, “Bocas”),  
“cant\_bill\_aju” :dataset.getValueAt(0, “cant\_bill\_aju”),…other atributes})

I get the error on the Named Query line, I had already use that named query to insert data from text and numeric labels and is working ok.

Do you know why I keep getting the type error?, I tried converting to DataSet and the same error pops up. The code its on a momentary button Action performed event.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 3, 2019, 7:35pm UTC](https://forum.inductiveautomation.com/t/get-dataset-row-into-namedquery-to-make-a-tuple-duplicate-typed-error/23820/2 "2019-04-03T19:35:15Z")

</div>

Is your named query parameters expecting a string value and getting an integer instead, or vice versa?

---

<div class="post-metadata">

**Author:** ![jose.pablo.arguello](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@jose.pablo.arguello](https://forum.inductiveautomation.com/u/jose.pablo.arguello)\
**Post date:** [April 3, 2019, 9:15pm UTC](https://forum.inductiveautomation.com/t/get-dataset-row-into-namedquery-to-make-a-tuple-duplicate-typed-error/23820/3 "2019-04-03T21:15:31Z")

</div>

I found out I was putting a max(dataset,"columnname’) in one of the variables of the Name query, but it was not returning and int value. Just the columnname…
