Advertisement
Guest User

Untitled

a guest
May 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. import cx_Oracle
  2.  
  3.        conexion='jaimeg/jaime_123@PRUEBA'
  4.         db_conn = cx_Oracle.connect(conexion)
  5.         cursor = db_conn.cursor()
  6.         q = "insert into CONTACTO(codigo, nombres, apellidos, telefono, celular, pais, ciudad, direccion, email) values(:c1,:c2,:c3,:c4,:c5,:c6,:c7,:c8,:c9)";
  7.         cursor.execute(q,c1=self.textCtrl1.Value,c2=self.textCtrl2.Value,c3=self.textCtrl3.Value,c4=self.textCtrl4.Value,c5=self.textCtrl5.Value,c6=self.textCtrl6.Value,c7=self.textCtrl7.Value,c8=self.textCtrl8.Value,c9=self.textCtrl9.Value)
  8.         if cursor.rowcount == 0:
  9.             db_conn.commit()
  10.             cursor.close()
  11.             db_conn.close()
  12.             dlg = wx.MessageBox('Cogido ya agregado!!!!!!!','Agenda')  
  13.         else:
  14.             db_conn.commit()
  15.             cursor.close()
  16.             db_conn.close()
  17.             dlg = wx.MessageBox('Contacto Agregado','Agenda')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement