Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL*Loader - Update Not Insert

Status
Not open for further replies.

gsdcrazy

Programmer
Sep 2, 2002
31
0
0
US
Gurus,

This is probably a very elementary question, but I am frustrated. How to I set SQL*Loader to update existing rows, but not insert new rows when the record does not exist in the table? I have tried

LOAD DATA
REPLACE
INTO TABLE ag_ma_indicator_trans
(ENTITY_ID position(001:010) char,
MA_ALLOWED_IND position(011:011) char,
MA_ELECTION_CHG_DATE position(012:019) date 'MMDDYYYY',
AG_ALLOWED_IND position(020:020) char,
AG_ELECTION_CHG_DATE position(021:028) date 'MMDDYYYY',
CLERK_ID position(029:038) char
)

but the REPLACE seems to insert new rows when the key (ENITITY_ID) does not exist in the table. I would like the records to go to the BAD file or, at least, somewhere else.

Any help would be greatly appreciated.

Thanks,
gsdcrazy
 
sqlload your data into a temporary table then use the SQL UPDATE command to update your main data based on the values in your temp table
 
taupirho,

Thanks. Guess I just wanted SQL*Loader to do something that it can not. I'll implement your solution.

Thanks again,
gsdcrazy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top