tags:

views:

134

answers:

1

With MySQL 5.1.43.

I am trying to create a trigger like this:

USE `databaseA`;
DELIMITER $$

CREATE DEFINER=`root`@`localhost` trigger triggerName 
BEFORE INSERT ON tableA
FOR EACH ROW BEGIN

IF(convert(new.subTime, signed) > '600') THEN
SET new.fieldA = new.fieldB;
END IF;

END$$

When I insert a record the fieldA field does not update.

Is there something wrong with my syntax?

Can I use the CONVERT statement in the trigger?

A: 

I just tested your trigger and it works fine. Is there any error message? Also take a look at INFORMATION_SCHEMA -> TRIGGERS and check is your trigger defined properly.

Piotr Pankowski