Import data from comma delimited csv/Excel file to Teradata table

Database
Enthusiast

Import data from comma delimited csv/Excel file to Teradata table

Dears,

I am trying to compare test query results with my BO Report data. So I have exported my BO report data into Excel/csv and the same needs to be imported to Teradata temp table; Finally I will excute minus query between my test query and imported BO data.

I tried import using .txt file(code below); It works fine. But how to import csv/excel files in Teradata?

/*Enable export option in sqla (File -> Export Results) & save as .txt delimited file*/

sel calendar_date,
day_of_week,
day_of_month,
day_of_year,
day_of_calendar,
weekday_of_month,
week_of_month,
week_of_year,
week_of_calendar,
month_of_quarter,
month_of_year,
month_of_calendar,
quarter_of_year,
quarter_of_calendar,
year_of_calendar
from SYS_CALENDAR.CALENDAR
where calendar_date = date;

/*Create a volatile table with the same structure of exported data table*/

create volatile table cal as
(sel calendar_date,
day_of_week,
day_of_month,
day_of_year,
day_of_calendar,
weekday_of_month,
week_of_month,
week_of_year,
week_of_calendar,
month_of_quarter,
month_of_year,
month_of_calendar,
quarter_of_year,
quarter_of_calendar,
year_of_calendar
from SYS_CALENDAR.CALENDAR
where 1 <> 1)
with data
on commit preserve rows;

/*If there is any date column make sure that date format in text file & sqla date format (Tools -> Options -> Date Format -> Display dates in this format -> Select 'YYYY-MM-DD') are in sync*/

/*Enable Import Results (File -> Import Results) & Insert into table using import parameter (?,??,?B or ?C) */

insert into cal values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);

sel * from cal;

Looking for your help!

Tags (4)