Thanks to all of you, I started learning SQL and I was able to INSERT data into the table via a script, this script also generates a report with the captured data and when the report it’s generated the script deletes the data off the table:
def runAction(self, event):
if event.path[0] == 0 and event.path[1] == 6 and event.path[2] == 1 and event.path[3] == 0:
t_stamp = system.date.now()
CV1_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV1_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV1_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV1_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV1_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV1_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/Axle CV1/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
CV2_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV2_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV2_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV2_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV2_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV2_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 2/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
CV3_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV3_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV3_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV3_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV3_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV3_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 3/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
CV5_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV5_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV5_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV5_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV5_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV5_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV5/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
CV6_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV6_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV6_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV6_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV6_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV6_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 6/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
CV7_M_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/Matutino/TEO_TP/TEOTOTALMIN")[0].value
CV7_M_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/Matutino/TEO_TP/TPTOTALMIN")[0].value
CV7_V_TEO = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/Vespertino/TEO_TP/TEOTOTALMIN")[0].value
CV7_V_TP = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/Vespertino/TEO_TP/TPTOTALMIN")[0].value
CV7_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/TEO_TP_TOTALTURNO/TEOTOTALMIN")[0].value
CV7_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/CV 7/stopcond/TEO_TP_TOTALTURNO/TPTOTALMIN")[0].value
KENMEX_TEO_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/Kenmex Monitoreo/Kenmex Monitoreo Totales/TEO_TOTALMIN")[0].value
KENMEX_TP_TOTAL = system.tag.readBlocking("[Kenmex]Kenmex/Kenmex Monitoreo/Kenmex Monitoreo Totales/TP_TOTALMIN")[0].value
Paso = False
CONSULTA = "INSERT INTO assy_kenmex_monitoreo_click (t_stamp,CV1_M_TEO,CV1_M_TP,CV1_V_TEO,CV1_V_TP,CV1_TEO_TOTAL,CV1_TP_TOTAL,CV2_M_TEO,CV2_M_TP,CV2_V_TEO,CV2_V_TP,CV2_TEO_TOTAL,CV2_TP_TOTAL,CV3_M_TEO,CV3_M_TP,CV3_V_TEO,CV3_V_TP,CV3_TEO_TOTAL,CV3_TP_TOTAL,CV5_M_TEO,CV5_M_TP,CV5_V_TEO,CV5_V_TP,CV5_TEO_TOTAL,CV5_TP_TOTAL,CV6_M_TEO,CV6_M_TP,CV6_V_TEO,CV6_V_TP,CV6_TEO_TOTAL,CV6_TP_TOTAL,CV7_M_TEO,CV7_M_TP,CV7_V_TEO,CV7_V_TP,CV7_TEO_TOTAL,CV7_TP_TOTAL,KENMEX_TEO_TOTAL,KENMEX_TP_TOTAL) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
VALORES = [t_stamp,CV1_M_TEO,CV1_M_TP,CV1_V_TEO,CV1_V_TP,CV1_TEO_TOTAL,CV1_TP_TOTAL,CV2_M_TEO,CV2_M_TP,CV2_V_TEO,CV2_V_TP,CV2_TEO_TOTAL,CV2_TP_TOTAL,CV3_M_TEO,CV3_M_TP,CV3_V_TEO,CV3_V_TP,CV3_TEO_TOTAL,CV3_TP_TOTAL,CV5_M_TEO,CV5_M_TP,CV5_V_TEO,CV5_V_TP,CV5_TEO_TOTAL,CV5_TP_TOTAL,CV6_M_TEO,CV6_M_TP,CV6_V_TEO,CV6_V_TP,CV6_TEO_TOTAL,CV6_TP_TOTAL,CV7_M_TEO,CV7_M_TP,CV7_V_TEO,CV7_V_TP,CV7_TEO_TOTAL,CV7_TP_TOTAL,KENMEX_TEO_TOTAL,KENMEX_TP_TOTAL]
FILAS_INSERTADAS = system.db.runPrepUpdate(CONSULTA, VALORES)
if FILAS_INSERTADAS > 0:
Paso = True
else:
Paso = False
def GENERAR_REPORTE():
data = system.report.executeReport("assy_kenmex/Kenmex Monitoreo/Kenmex Monitoreo_Click", fileType = "pdf")
system.perspective.download("Kenmex Monitoreo_"+(system.date.format(t_stamp, "MM-dd-yy_hh-mm a"))+".pdf", data)
if Paso == True:
GENERAR_REPORTE()
Paso1 = True
def ELIMINAR_DATOS():
CONSULTA1 = "DELETE FROM assy_kenmex_monitoreo_click; TRUNCATE TABLE assy_kenmex_monitoreo_click"
ELMINAR = system.db.runPrepUpdate(CONSULTA1)
if Paso1 == True:
ELIMINAR_DATOS()
Thank you all for your help!!