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

namedqueries
#1

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.

0 Likes

#2

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

0 Likes

#3

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…

1 Like