-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmysqlQuerys.py
More file actions
20 lines (15 loc) · 801 Bytes
/
mysqlQuerys.py
File metadata and controls
20 lines (15 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sqlite3
from sqliteQuerys import selectAllSignals
from mysqlConnect import connect
conn = connect()
connect = conn.cursor()
#-------------------------------------------------------------------------------
# Realiza o cadastro dos registros no banco externo
#-------------------------------------------------------------------------------
def exportDataToExternalDatabase(quatidade, linha_producao, linha_descricao, hora, created_at):
created_at = created_at + " " + str(hora) + ":00:00"
connect.execute("""
INSERT INTO producao (quantidade, linha_producao, linha_descricao, hora, created_at)
VALUES (%s, %s, %s, %s, %s)""", (quatidade, linha_producao, linha_descricao, hora, created_at))
conn.commit()
#-------------------------------------------------------------------------------