Mysql Error in query statements

Posted by Mark Estrada on Stack Overflow See other posts from Stack Overflow or by Mark Estrada
Published on 2011-01-06T08:46:38Z Indexed on 2011/01/06 8:53 UTC
Read the original article Hit count: 435

Filed under:
|

Hi All,

I am trying to acquaint myself on Mysql syntax. I only have used MSSQL so far. I downloaded the Mysql Query Browser and have installed the Mysql Version 5.1

I wanted to run this line of code in the resultset tab of mysql but I keep on encountering below error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare iCtr int' at line 1

declare iCtr int;
set iCtr = 1;

while iCtr < 1000
begin
    insert into employee (emp_id,emp_first_name,emp_last_name,status_id)
      values (iCtr, 'firstName' + iCtr, 'lastName' + iCtr, 1)
      set iCtr = iCtr + 1;
end

I just wanted to populate my employees table but I cannot get past the mysql syntax. Any advise please. Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query