vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| "Leigh Williams" <leighwilliams@gmail.com> schreef in bericht news:1182018876.701121.265290@p77g2000hsh.googlegr oups.com... > Hi All, > > I am new to MySQL and cannot get a trigger working.. I keep getting > errors. > > How can I create a trigger that prevents a user from entering (new or > editing) a varchar that has less than 4 characters? > > Thanks in advance, > Leigh > http://dev.mysql.com/doc/refman/5.0/en/triggers.html |
| ||||
| On Jun 16, 2:34 pm, Leigh Williams <leighwilli...@gmail.com> wrote: > Hi All, > > I am new to MySQL and cannot get a trigger working.. I keep getting > errors. > > How can I create a trigger that prevents a user from entering (new or > editing) a varchar that has less than 4 characters? > > Thanks in advance, > Leigh In this case you really shouldn't use a trigger -- use a "check" constraint instead: create table foo ( bar varchar(50), check (length(bar) >= 4) ) |
| Thread Tools | |
| Display Modes | |
|
|