Page 1 of 1

Assigning mysql functions at field level

Posted: Wed Feb 28, 2007 4:54 pm
by GeXus
Is it possible to assign a mysql function at the field level of a table? Say for example I wanted to encrypt all data that is inserted into a particular field with aes_encrypt(), instead of simply using this in the insert, it could be cool if you could just set it to always use that on any data inserted into that field...

Posted: Wed Feb 28, 2007 8:38 pm
by Begby
This is where stored procedures come into play. Check it out on the mysql web site.

Posted: Wed Feb 28, 2007 10:05 pm
by feyd
Triggers would by my preferred variant of solution. :)

Posted: Thu Mar 01, 2007 9:39 am
by GeXus
Ahh triggers seem perfect... now I can justify upgrading mysql.