Hello,
I am trying to import data from excel file into teradata table. I can connect to teradata and read the excel file but i was wondering how can i import the data from excel to table
This is what i have for now. Code is reading the excel file and creating the table.
I am trying to import data from excel file into teradata table. I can connect to teradata and read the excel file but i was wondering how can i import the data from excel to table
This is what i have for now. Code is reading the excel file and creating the table.
import pandas as pd
import numpy as np
import datetime
import pyodbc
import os.path, time
import platform
import glob
import codecs
import csv
from pathlib import Path
import tkinter as tk
from tkinter import filedialog
import teradata
df = pd.read_excel (r'C:\Users\sss\Documents\Adjustments.xls', sheet_name='Adjustments')
print (df)
host,username,password = 't33.serv.hhh.com','user', 'password'
#Make a connection
udaExec = teradata.UdaExec (appName="test", version="1.0", logConsole=False)
with udaExec.connect(method="odbc",system=host, username=username,
password=password, driver="Teradata Database ODBC Driver 16.20") as connect:
query1="DROP TABLE astertest.Adjustments"
with udaExec.connect(method="odbc",system=host, username=username,
password=password, driver="Teradata Database ODBC Driver 16.20") as connect:
connect.execute("DROP TABLE astertest.Adjustments;")
connect.commit()
connect.execute("CREATE TABLE astertest.Adjustments (col1 varchar(100), col2 varchar(100), col3 varchar(100))")
connect.commit()
