Insert Files Into Fields Question

[expired user #3289]'s profile image [expired user #3289] posted 14 years ago in General Permalink
I'm trying to insert columns, from one table, into another.

I already tried an INSERT command, but it did not work. Although my syntax was correct, there was a logical error; mysql would only start inserting new data on the line immediately following the bottom of the existing columns of data.

So, now, I am wondering if Import>Insert Files Into TEXT/BLOB Fields... will help.

Any thoughts?

- j

ansgar's profile image ansgar posted 14 years ago Permalink
I have a gutt feeling you need UPDATE, not INSERT for whatever you're trying to achieve.

However, the "Insert files" dialog creates new rows, and does not update anything.
[expired user #3289]'s profile image [expired user #3289] posted 14 years ago Permalink
Using Heidisql's query editor, I tried the following code to insert the contents of 3 columns, from phpbb2_posts_text, into 3 columns of phpbb3_posts3.

Both tables are located in the same database.

Further, phpbb3_posts3's post_id column already exists and sequentially increases, from 2 to 218727.

UPDATE phpbb2_posts_text A, phpbb3_posts3 B
SET B.bbcode_uid=A.bbcode_uid,B.post_subject=A.post_subject,B.post_text=A.post_text
WHERE B.post_id<=218727


Unfortunately, the above code resulted in the following error message:

SQL Error (1): Can't create/write to file '/tmp/#sql_4bd9_0.myi' (Errcode:13)

I have a feeling that the error is not code-related, but I would appreciate learning your opinion.

Please reply.

- j
ansgar's profile image ansgar posted 14 years ago Permalink
Errorcode 13 is "Permission denied" (see "perror.exe 13")

You're right - this is not code related. It's the MySQL server being unable to write to /tmp . I guess the system user which MySQL uses to run needs some more privileges.

Please login to leave a reply, or register at first.