Error-1064 with select into

User, date Message
User: maxman92
Posted: Wed, 14 Jul 10 15:45
Category: General
5 posts since Wed, 14 Jul 10
Hi,
I'm new to using mysql and this error is baffling me. I have a table in which the data is imported from a text file. The dates are in a mm/dd/yyyy format and I was trying to make a script to take the date and reformat it into the correct format. This is the script so far.
BEGIN
declare str varchar(50);
declare prima int default 1;

while prima <= 240350
select dates into str
from transytd_d
where prim=prima;
update transytd_d
set newdate=str_to_date(str,'%M/%d/%y')
where prim=prima;
set prima=prima+1;
end while;
END

When I attempt to save it, it throws an error 1064 saying I should check the manual for the syntax to use around "select dates... update transytd_d"
I have no clue what's wrong. Any ideas?
User: maxman92
Posted: Wed, 14 Jul 10 20:45
5 posts since Wed, 14 Jul 10
Nevermind. I forgot the "do" after the while statement.
 

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