Hello,
i'm new about triggers...
I'm trying to create one trigger: it may insert into a column the user that insert the record...

my table----->
CREATE TABLE `test`.`t2` (
 `s1` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
 `utente` VARCHAR(80) NOT NULL DEFAULT '',
 PRIMARY KEY(`s1`)
)
ENGINE = InnoDB;

then my trigger----->
create trigger inserisci_t
after insert on t2
for each row
update t2 set utente= current_user where s1= NEW.s1;

When i try to insert:----->
insert into t2(s1) values (8);

it responds:----->
"Can't update table 't2' in stored function/trigger because it is already used by statement which invoked this function/trigger."

Any suggestion about my trigger?
Thank you in advance!

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

Reply via email to