I am trying to connect to SnowFlake from an Azure VM. I made a simple class method that looks like below: class SQLClient(): def __init__(self, user, password, account): super().__init__() self.conn = None self.user = user self.password = password self.account = account self.open_connection() def open_connection(self): if not self.conn: log.info(f’Opening DB connection.’) self.conn = snowflake.connector.connect(user=self.user, password=self.password, account=self.account) ..
Hello I’m programming my ESP8266 like client sending data of a pH sensor and flowmeter. For send the data of the ESP8266 i did a socket connection to the server. But the problem here is that the data that i sent is rejected. See the error: pymysql.err.ProgrammingError: (1064, "You have an error in your SQL ..
I am working with a sql table and want to iterate through it horizontally. I am currently using the django Q library to create query sets: I am creating and filtering the QuerySets by doing : filtered_table = NewTables07.objects.filter(criterion_date & criterion_location) The model looks like: class NewTables07(models.Model): TestDate = models.CharField(max_length=200) Division = models.CharField(max_length=200) Library = ..
So I’m currently trying to insert tuples into a database. I made a for loop for certain elements to only be printed out and put into the database, but whenever I go to run it, I get nothing and none of the tables are populated. It’ll print out in the shell, but not in the ..
I want to insert into my MySQL Workbench database in my python script but I am having issues trying to get it to only insert once if a certain value already exist. So lets say I’m inserting names and the name ‘Bob’ is already in the DB, I don’t want to insert it again at ..
I have some large csv files which I need to merge them together. each file is about 5gb and my RAM is only 8gb. I use the following code to read some csv files into dataframes and merge them on columns fund_ticker ticker and date. import numpy as np import pandas as pd # Read ..
I have searched extensively before asking this seemingly simple question. I have a python project, made a sqlite DB and some code to insert and work with it, and all was good until I decided to pull the db functions out of the main file, and pull out the db file, and put both into ..
I got this sqlite3 code to work perfectly when it was in the main body of the program, and I thought that was that, but then I wrote more code so this would execute once a month (on the first day of the month) and that code works fine, but now when the table entries ..
The problem is occuring in the ModifyRecords class I have commented at the line where button is connected to a function but does not call the function. import mysql.connector from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.b1 = QtWidgets.QPushButton(self.centralwidget) self.b1.setGeometry(QtCore.QRect(210, 30, 321, 31)) font ..
So basically, this is a SQLite3 table that I have: Click Here for Image As you can see in the image, there are 8 distinct dates, going from 29/07/2021 to 05/08/2021. I want to run a SQLite3 Query that returns only the latest 7 out of these 8 dates (i.e. 30/07/2021 to 05/08/2021) BUT it ..