0

I'm ruuning below script to insert data from .csv file to oracle table A. How I can update code to clear data of table A first and then insert data using one file.

load data
append
INTO TABLE USB.BAS2_AGENCY_TO_RISKRATING_TRAN
fields terminated by ','
optionally enclosed by '"'
(AS_OF_DATE "TO_DATE(:AS_OF_DATE,'DD-MON-YYYY')"
,MOODY,S_AND_P,FITCH,DBRS,RISK_RATING,BAS_RISK_RATING)
Tim Klein
  • 2,538
  • 15
  • 19
Sachin Sharma
  • 352
  • 5
  • 18

1 Answers1

0

Instead of "APPEND" use "TRUNCATE". Back up first before testing!

Gary_W
  • 9,933
  • 1
  • 22
  • 40
  • So new script will be like load data Truncate INTO TABLE USB.BAS2_AGENCY_TO_RISKRATING_TRAN fields ... This will clear the table how it'll insert new records into table. I want to achieve both the task i.e. clearing previous table records and inserting new records in empty table – Sachin Sharma Apr 16 '19 at 19:33