hi, im a newbie and just read about triggers.. i am trying to create a trigger using navicat for mysql
in the triggers tab for the table i select new trigger with update after insert( these are the ready options it has)
then in the definition i added
DELIMITER || FOR EACH ROW BEGIN UPDATE tblitemstock SET TotalQuantity = (Totalquantity - NEW.qty) WHERE itemname=NEW.itemname; END || DELIMETER ;

but that gives me a syntax error..
pls help me in fixing this

Member Avatar for LastMitch

i am trying to create a trigger using navicat for mysql in the triggers tab for the table i select new trigger with update after insert( these are the ready options it has) then in the definition i added

Read this:

http://www.navicat.com/manual/online_manual/Navicat11/en/mac/TriggersMySQL.html

BEGIN
  set new.capacity = new.capacity + 100;
  set new.amount = new.amount + 100;
END
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.