List:General Discussion« Previous MessageNext Message »
From:B. Keith Murphy Date:May 3 2007 12:08pm
Subject:Re: Enforcing Data Format
View as plain text  

Baron Schwartz wrote:
> Hi,
>
> Tim Milstead wrote:
>> Hello,
>>
>> Is it possible to enforce data formatting in fields using something 
>> like a regular expression?
>> varchar is great but does not stop someone putting in the wrong 
>> reference number.
>> I suspect the answer is no, you have to do it at a higher level. What 
>> aprroach would people suggest?
>> Perhaps another table with two fields - field_name and field_regex?
>>
>
> If you are using 5.x or greater, you can do some kinds of data 
> validation with a trigger.
>
> Baron
>
I would argue that your data-validation should really not be done with 
triggers - I would look more at the php/asp/whatever code to do this.  
Shouldn't this be more efficient than using triggers?  At the very least 
doing validation on the web server will make it easier to add capacity 
with multiple web servers.

Keith


Thread
Enforcing Data FormatTim Milstead3 May
  • Re: Enforcing Data FormatBaron Schwartz3 May
  • Re: Enforcing Data FormatMartijn Tonies3 May
    • RE: Enforcing Data FormatEdward Kay3 May
      • Re: Enforcing Data FormatMartijn Tonies3 May
  • Re: Enforcing Data FormatMogens Melander3 May
    • Re: Enforcing Data FormatStephen Cook3 May
  • Re: Enforcing Data FormatMartijn Tonies3 May
Re: Enforcing Data FormatB. Keith Murphy3 May