troubleshooting Question

# SQL Select INTO query doesn't work

MySQL ServerDatabases
I am using phpMyAdmin to develop a database. I have two tables named:

press1_parameters

sheet2

Sheet2 is data imported from an Open Office excel sheet.

Both sheet2 and press1_parameters have the same column names set to the same data types as below:

Table: sheet2

Date (is not a data type just input data)
Product
Plys
Speed
Catalyst
Zone_Temps
Kws
BTU
WireTemps
Ambient
GluePumpSp

Table: press1_parameters

PWC_1 (Primary Key)
Date (is not a data type just input data)
Product
Plys
Speed
Catalyst
Zone_Temps
Kws
BTU
WireTemps
Ambient
GluePumpSp
Index

All data types in both tables are “varchar”

I need to move all the data in table “sheet2” into table “press1_parameters”

I am using the following SQL statement:

SELECT * FROM `sheet2`

INTO press1_parameters

I get the following error:

#1327 Undeclared variable: press1_parameters

I can use the Select * statement and get all the data from either table but when I use it as above I get the aforementioned error

I also tried the following and it works until I use the INTO command after the FROM command

SELECT`Date`, `Product`, `Plys`, `Speed`, `Catalyst`, `Zone_Temps`, `KWs`, `BTU`, `WireTemps`, `Ambient`, `GluePumpSp`, `Spread`, `Chisel_Grade`, `Notes`

FROM sheet2

INTO press1_parameters

I get the same error:

#1327 Undeclared variable: press1_parameters

I have also tried the following and still get the same error

SELECT`Date`, `Product`, `Plys`, `Speed`, `Catalyst`, `Zone_Temps`, `KWs`, `BTU`, `WireTemps`, `Ambient`, `GluePumpSp`, `Spread`, `Chisel_Grade`, `Notes`

FROM sheet2

INTO press1_parameters

VALUES

`Date`, `Product`, `Plys`, `Speed`, `Catalyst`, `Zone_Temps`, `KWs`, `BTU`, `WireTemps`, `Ambient`, `GluePumpSp`, `Spread`, `Chisel_Grade`, `Notes`

I am still new to SQL so any suggestions would be helpful.
Qlemo
"Batchelor", Developer and EE Topic Advisor
###### Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.