Hello,
Is there a way to check a condition for date before importing data from OneDrive excel file to Terada's table in order to avoid duplicate records?
So, someone else maintains an excel file on OneDrive and I just pick up this data every week and import them into the Teradata's table.
Now, I would like to automate the process and schedule the flow to pick up this data but before INSERT the data to check if "date_month" already exists in Teradata's table. If "date" exists DO NOT import/insert data ELSE insert.
I have tried with PRE Create SQL statement in Database window (picture below) but do not know how to call OneDrive file in this statement:
IF NOT EXISTS (SELECT DISTINCT date_month
FROM tedw.table1
WHERE date_month = (SELECT DISTINCT date_month FROM "OneDrive PATH folder" WHERE date_month IS NOT NULL))

As I do not know how to "call" OneDrive file/path here, is there some better solution?
Thank you in advance.