Is it possible to SET values on fields that involve the TABLE that invoked the TRIGGER with SET actions.
I have the following lines in my trigger:

delimiter //
CREATE TRIGGER trigger_registration_and_attendance_before_insert
BEFORE INSERT
ON registration_and_attendance
FOR EACH ROW
BEGIN
   DECLARE schedule_class_id INT;
DECLARE schedule_class_id_cursor CURSOR FOR SELECT class_id FROM schedules WHERE schedules.id = new.schedule_id;
   FETCH schedule_class_id_cursor INTO schedule_class_id;
   SET new.class_id = schedule_class_id;
END;

The server accepts this but "new.class_id" doesn't get a value when I do an INSERT. Why won't this work?

Ferindo

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to