Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def conexionBDAlquimia():
- try:
- conn = mariadb.connect(
- user="xxxxx",
- password="xxxxx",
- host="alquimia-produccion.czyvqwotxq1n.us-east-1.rds.amazonaws.com",
- port=3306,
- database="alquimia_vitae"
- )
- except mariadb.Error as e:
- print(f"Error en conexiΓ³n a base de datos: {e}")
- sys.exit(1)
- cur = conn.cursor()
- return cur
- def consultaSaldoCuentaAlquimia(cur,idCuenta):
- try:
- cur.execute(
- "select saldo_ahorro from alquimia_vitae.cuenta_ahorro_cliente where id_cuenta_ahorro ="+str(idCuenta)
- )
- record = cur.fetchone()
- saldo = record[0]
- return saldo
- except mariadb.ProgrammingError as e:
- print(f"Error en consulta a base de datos: {e}")
- #sys.exit(1)
- def determinaCuentaAlquimiaPorCLABE(cur,clabe):
- try:
- cur.execute(
- "select id_cuenta_ahorro from cuenta_ahorro_medio_pago where no_cuenta_medio_pago ='"+str(clabe)+"'"
- )
- record = cur.fetchone()
- idCuenta = record[0]
- return idCuenta
- except mariadb.ProgrammingError as e:
- print(f"Error en consulta a base de datos: {e}")
- #sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement