I am trying to update the column in cassendra using python script.
but i am getting error TypeError: cannot concatenate 'str' and 'UUID' objects
active = session.execute("select id, status from address where status = 'A'")
for row in activeCampaigns:
session.execute("update address set status = 'ACTIVE' where id = "+row.id);
could someone assist me in resolving this issue?
row.id is most likely a UUID object. You should try either converting it to its string representation before concatenation:
session.execute("update ... id = " + str(row.id))
or use proper string formatting:
session.execute("update ... id = {}".format(row.id))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With