| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Ferindo Middleton Jr | Date: | January 7 2006 3:34am |
| Subject: | SETting values to TABLE field at TRIGGER runtime | ||
| View as plain text | |||
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
| Thread | ||
|---|---|---|
| • SETting values to TABLE field at TRIGGER runtime | Ferindo Middleton Jr | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime | Gleb Paharenko | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime | Ferindo Middleton Jr | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime - FLAW IN MYSQLTRIGGER IMPLEMENTATION? | Ferindo Middleton Jr | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime - FLAW IN MYSQLTRIGGER IMPLEMENTATION? | Ferindo Middleton Jr | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime - FLAW IN MYSQLTRIGGER IMPLEMENTATION? | Ferindo Middleton Jr | 7 Jan |
| • Re: SETting values to TABLE field at TRIGGER runtime | Ferindo Middleton Jr | 7 Jan |
