MySQL Forums
Forum List  »  Newbie

Re: How to fill fields with automatically
Posted by: Rieqy Erysya
Date: July 06, 2012 05:42PM

Peter Brawley Wrote:
-------------------------------------------------------
> drop table if exists t;
> create table t(s char(16),hash binary(32));
> create trigger t before insert on t for each row
> set new.hash=md5(new.s);
> insert into t values('abcde',null);
> select * from t;

it worked. thanks..
by the way,can you tell me small difference between AFTER dan BEFORE on trigger ?
or VARCHAR(32) with BINARY(32) ? please..=))



Edited 1 time(s). Last edit at 07/06/2012 06:11PM by Rieqy Erysya.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.