troubleshooting Question

SQL Select INTO query doesn't work

Avatar of James Coats
James CoatsFlag for United States of America asked on
MySQL ServerDatabases
7 Comments1 Solution3227 ViewsLast Modified:
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
Spread
Chisel_Grade

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
Spread
Chisel_Grade
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.
ASKER CERTIFIED SOLUTION
Qlemo
"Batchelor", Developer and EE Topic Advisor
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
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.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros