dazormiq Posted February 8, 2007 Share Posted February 8, 2007 How can I convert the following sql code to working mysql? SELECT Employees.Email AS employee_email, Job_Titles.Supervisor AS Supervisor_Title INTO Supervisors_temp FROM Job_Titles INNER JOIN Employees ON Job_Titles.Job_Title_ID = Employees.Job_title_ID; I keep getting "Undeclared variable: Supervisors_temp". The table exists and gets truncated before the data is put into it. Currently these tables are stored in an access database being edited through a coldfusion page. I would love to move to mysql just for the performance boost. Quote Link to comment https://forums.phpfreaks.com/topic/37666-solved-selectinto-error/ Share on other sites More sharing options...
effigy Posted February 8, 2007 Share Posted February 8, 2007 Is this in a function or procedure? If so, declare the variable beforehand: DECLARE Supervisors_temp VARCHAR(50); Quote Link to comment https://forums.phpfreaks.com/topic/37666-solved-selectinto-error/#findComment-180161 Share on other sites More sharing options...
artacus Posted February 8, 2007 Share Posted February 8, 2007 INSERT INTO Supervisors_temp SELECT Employees.Email AS employee_email, Job_Titles.Supervisor AS Supervisor_Title FROM Job_Titles INNER JOIN Employees ON Job_Titles.Job_Title_ID = Employees.Job_title_ID Quote Link to comment https://forums.phpfreaks.com/topic/37666-solved-selectinto-error/#findComment-180227 Share on other sites More sharing options...
dazormiq Posted February 9, 2007 Author Share Posted February 9, 2007 Putting the insert into in front did it. Thanks for helping this newbie out. Quote Link to comment https://forums.phpfreaks.com/topic/37666-solved-selectinto-error/#findComment-180604 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.