I tried to add some values into my database. But got some errors.
However on searching the forum, i got to see your post and some steps.
I followed the same, but I am getting error as per the picture attached.
Dont understand where exactly i am making a mistake.
Initially i tried to do as per Inductive University video. That didnt work and so i tried your script.
Both gave me the same error message.
I think something i am missing in my computer to do these scripting.
As i am new to iginition, python and stuff, i am not able to track the issue.
Below is the script I have used. I have 3 text field and the datas in the text field have to be added in the database when i press an button,
MY SCRIPT
idtag = event.source.parent.getComponent(‘container1’).getComponent(‘bee1’).text
tagvalue = event.source.parent.getComponent(‘container1’).getComponent(‘bee2’).text
tagname = event.source.parent.getComponent(‘container1’).getComponent(‘bee3’).text
table = event.source.parent.getComponent(‘Table’)
db = “tagvalue”
Create the insert query
insertQuery = “”“INSERT INTO [%s] ([idtag], [tagvalue], [tagname])
VALUES (’%s’, ‘%s’, ‘%s’, ‘%s’, ‘%s’, %d)”"" % (tableName, idtag, tagvalue, tagname)
Insert the record in the database table
system.db.runUpdateQuery(insertQuery,db)
Refresh the table data
system.db.refresh(table, “data”)