Copy Columns from MyISAM table1 to InnoDB table2

Hey guys,

I have 2 tables in MySQL

One called “oc_products” and one called “oc_products2”

I would like to copy all the columns in “oc_products2” to “oc_products”

I ran the following query

 INSERT into oc_products (column_name1, column_name2) 
                           SELECT column_name1, column_name2 from oc_products2

Now this works but the DATA is not copied across, all I get is the values “0”

Error Message = MySQL returned an empty result set (i.e. zero rows). (Query took 0.0241 sec)

What am I doing wrong?

So if you run just this query, you get a recordset returned?

So if you run just this query, you get a recordset returned?

Correct I get all the recordsets returned

Ok now I think I have stumbled on something.

When I click the oc_product Table I get the options (Edit Copy Delete) in PhpMyAdmin

but when I click on the oc_product2 Table I don’t get these options

The oc_product2 is set to InnoDB where as the oc_product is set to MyISAM

No one knows ???

It is the weekend in majority of the world. As volunteers here (everyone here is), we tend to have things going on on the weekends which leads us to not be on Sitepoint.

I’d imagine you’d need to wait until Monday at least unless someone hops on here during the weekend.

Hi Ryan,

Sorry was doing my head in.

Actually figured it out eventually.

Just have to play around with sql queries.

Also columns were not indexed which they are now

Have a nice weekend

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.