StupidRalph
02-06-2008, 04:42 AM
I have a third party table that has 157,282 rows with no primary key which I will need for my webapp. So I want to create a unique value by concatenating the values of two columns and insert them in the newly added 'id' column.
INSERT INTO lieb_linkbase (id) (SELECT CONCAT(PUBLISHER,'-',NUMBER) FROM lieb_linkbase);
I just ran this query and it returned: "(157282 row(s)affected)
(0 ms taken)" which is the total amount of rows in my table. And it actually took longer than stated. However, when I went to check my dataset I seen that the id column was still NULL.
So I decided to run this from the command line to see what will happen and recieved this
080205 22:05:03 [ERROR] G:\xampp\mysql\bin\mysqld-nt.exe: Incorrect key file for table 'G:\xampp\tmp\#sql_2b4_0.MYI'; try to repair it
So a bit of Googling suggest that it had to do with available space of the tmp directory. So I moved it and ran the query a third time. This time it said...
Query OK, 629128 rows affected (3 min 42.21 sec)
Records: 629128 Duplicates: 0 Warnings: 0
And I still do not have the values inserted into my ID field...what gives? And why were so many rows affected!?! :confused:
INSERT INTO lieb_linkbase (id) (SELECT CONCAT(PUBLISHER,'-',NUMBER) FROM lieb_linkbase);
I just ran this query and it returned: "(157282 row(s)affected)
(0 ms taken)" which is the total amount of rows in my table. And it actually took longer than stated. However, when I went to check my dataset I seen that the id column was still NULL.
So I decided to run this from the command line to see what will happen and recieved this
080205 22:05:03 [ERROR] G:\xampp\mysql\bin\mysqld-nt.exe: Incorrect key file for table 'G:\xampp\tmp\#sql_2b4_0.MYI'; try to repair it
So a bit of Googling suggest that it had to do with available space of the tmp directory. So I moved it and ran the query a third time. This time it said...
Query OK, 629128 rows affected (3 min 42.21 sec)
Records: 629128 Duplicates: 0 Warnings: 0
And I still do not have the values inserted into my ID field...what gives? And why were so many rows affected!?! :confused: