[ciapug] mysql 3.x to mysql 4.1

carl-olsen at mchsi.com carl-olsen at mchsi.com
Fri Aug 18 10:28:09 CDT 2006


I would probably write some PHP to do it for me, although I'm not sure how much data you have.  I'm thinking I'd itterate through the rows and check for a duplicate value by doing a select statement before doing each row insert.

-------------- Original message from "Dave J. Hala Jr." <dave at 58ghz.net>: -------------- 


> When using mysql 3.26 I had this function that copied records from 
> table1 to table2. The query in the fucntion looks like this: 
> 
> INSERT INTO table2 (field1,field2) SELECT (field1, field2) FROM table1 
> WHERE field1='X' 
> 
> In table2, field1 was a primary key. If I ran the query, and tried to 
> insert a duplicate, mysql 3.x would just "skip" that insert and continue 
> on. After switching to mysql 4.x, I discovered that when 4.x encounters 
> a duplicate, it stops. This a problem. 
> 
> I took a wild guess and tried making field1 a "unique key" and it didn't 
> solve the problem. Anyone got a work around for this problem? 
> 
> 
> :) Dave 
> 
> -- 
> 
> Open Source Information Systems, Inc. (OSIS) 
> Dave J. Hala Jr., President 
> 641.485.1606 
> 
> _______________________________________________ 
> ciapug mailing list 
> ciapug at cialug.org 
> http://cialug.org/mailman/listinfo/ciapug 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/ciapug/attachments/20060818/ea866924/attachment.htm


More information about the ciapug mailing list