SQL Loader-Need to update or insert [message #294926] |
Sun, 20 January 2008 22:17 |
vino_83
Messages: 2 Registered: January 2008
|
Junior Member |
|
|
I am loading the table using sql loader as below:
LOAD DATA CHARACTERSET WE8ISO8859P1
APPEND INTO TABLE PRDC_CHR
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
BRN_CD,
CHR_NM,
CHR_VL_CD,
CHR_VL_DSC,
MAP_DT "to_date(sysdate, 'YYYYMMD')"
)
Instead of append here, I want to implement the merge functionality here, i.e., update if an existing record else insert the new record.
For eg.
Consider ,the table has got a record with BRN_CD as 20 with values for other fields. If the input file which is going to be appended also has a record with BRN_CD as 20 with some other values for other fields, I should update that particular record in the table with the new values for tht record from the file. If it's a completely new record, it should do an insert.
Thanks
vino
|
|
|
|
|
|