Q:

Error in event creation using MySQL

Am using the below code to create an EVENT in MYSQL. In this time i want to drop and create a table using a query.
Drop  Event  if exists EVT_UP_TIMESHEET;
CREATE EVENT EVT_UP_TIMESHEET
  ON SCHEDULE EVERY '1' Day
  STARTS '2012-08-01 12:00:00'
DO

  Drop table if exists tbl_temp;

 create table tbl_temp as ( SELECT e.userid            AS Employee_ID,

       e.memo              AS Employee_Name,
   e.Department        AS Department,
.....

It returns the following error:

ERROR : Table tbl_temp already exists.

Please help me to do this.

A:

As a workaround - try to use TRUNCATE TABLE and INSERT...SELECT statements instead of DROP/CREATE TABLE.

