I have a database in mysql
that contains a table with multiple expressions. I can extract the expressions through procedure
, solve them, but when I want to return the calculation value to the bank with another procedure
, this value is not saved. Here is the code below:
# mysql = MySQLdb.connect(host = "localhost", user = "client", passwd = "123456", db = "sist_dist")
mysql = MySQLdb.connect('192.168.252.30','client','123456','sist_dist')
mysql_cursor = mysql.cursor()
mysql_cursor.execute("call retira_exp('mangaba')")
linha_expressao = mysql_cursor.fetchone()
if linha_expressao=="":
sys.exit()
expressao_banco = linha_expressao[1]
id_expressao = linha_expressao[0]
resultado = eval(expressao_banco)
print resultado
mysql_cursor = mysql.cursor()
mysql_cursor.execute("CALL entrega_res('id_expressao','resultado')")