Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3978710
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:04:53+00:00 2026-05-20T05:04:53+00:00

while creating trigger in mysql i m getting error 1046. my query is: CREATE

  • 0

while creating trigger in mysql i m getting error 1046. my query is:

CREATE TABLE test.Employee(
              id            int,
              first_name    VARCHAR(30),
              last_name     VARCHAR(15),
              start_date    DATE,
              end_date      DATE,
              city          VARCHAR(10),
              description   VARCHAR(15)
          );


CREATE TABLE test.Employee_log(
              id int,
              first_name varchar(50),
              last_name varchar(50),
              start_date date,
              end_date date,
              city varchar(50),
              description varchar(50),
              Lasinserted Time
          );

when i am executing below lines it is giving error:

Error Code : 1064
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 'END$$ 
delimiter' at line 1
(16 ms taken)


delimiter $$
CREATE TRIGGER test.Employee_Trigger
     AFTER insert ON test.employee
     FOR EACH ROW
     BEGIN
     insert into test.employee_log values(new.id,new.first_name,
     new.last_name,new.start_date,new.end_date,
     new.city,new.description,curtime());
    END$$ 
delimiter ;

if some one could please help it would be greately appreciated.

Thanks
Yugal

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:04:53+00:00Added an answer on May 20, 2026 at 5:04 am

    trigger are not routine nor stored procedure,
    so there is not need for BEGIN...END, plus the table name is case sensitive

    CREATE TRIGGER Employee_Trigger
    AFTER insert ON Employee
    FOR EACH ROW
    INSERT INTO test.Employee_log values(new.id,new.first_name,
      new.last_name,new.start_date,new.end_date,
      new.city,new.description,curtime());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below mentioned stored procedure is giving error while creating Msg 156, Level 15, State
While creating a file synchronization program in C# I tried to make a method
While creating classes in Java I often find myself creating instance-level collections that I
I just noticed while creating a RESTful WCF service that the Method parameter on
I'm passing some numeric arguments while creating a process (in VC++) I'm stuck at
I realized the solution to this problem while I was creating the documentation to
I need to create a trigger in every database on my sql 2005 instance.
i'm trying to create a trigger that sets the id from a predefined sequence.
On our live/production database I'm trying to add a trigger to a table, but
I need to copy some data from one table to another in Oracle, while

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.