views:

176

answers:

1

If I have table B with foreign key references to table A (set to ON UPDATE CASCADE) and I run a

LOAD DATA INFILE file.txt REPLACE INTO TABLE A;

command, will the references update properly?

Please note that I'm not talking about ON DELETE CASCADE; I know a REPLACE command will delete records in table B if I have that set.

A: 

I actually got here after searching for a similar answer. It looks like REPLACE INTO still deletes items as long as you have ON DELETE CASCADE set for your constraint.

See http://www.mysqlperformanceblog.com/2007/01/18/insert-on-duplicate-key-update-and-replace-into/

Zahymaka