You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def Read_from_MS_SQL_Tid_float_Value(Tid = 0): #Чтение данных из MS SQL Server
SQL_CLI_READ ="SELECT TOP 1 [ID] ,[Tid] ,[Value] ,[QC] ,[DateTime] ,[RecDateTime] FROM [Data_Base].[dbo].[PV] WHERE [Tid]=" + str(Tid) + " ORDER BY [RecDateTime] DESC;"
print(SQL_CLI_READ)
cursor.execute(SQL_CLI_READ) #Отправить SQL команду
print("MS SQL Server:")
row = cursor.fetchone()
print("ID = " , row[0])
print("Tid = " , row[1])
print("Value = " , row[2])
print("QC = " , row[3])
print("DateTime = " , row[4])
print("RecDateTime = ", row[5])
return float(row[2])
#Подключение к базе данных MS SQL через ODBC (DB API 2.0)