Help for this page

Select Code to Download


  1. or download this
        <table name="foo">
            <field name="a" required="1"/>
            <field name="b" validate="\d+\.\d+\.\d+"/>
            <field name="c" required="if a"/>
        </table>
    
  2. or download this
        package Model::Validate::Foo;
    
    ...
                die "c is required if a" if $value_of{a};
            }
        }
    
  3. or download this
        <table name="foo">
            ...
            <constraint name="avg_a" value="average(a) > 100"/>
        </table>
    
  4. or download this
        sub avg_a {
            # called on insert, update of table foo
            # check if average(a) > 100
        }