Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Where to do Data Validation?

Re: Where to do Data Validation?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Mon, 19 Nov 2007 10:25:44 -0800 (PST)
Message-ID: <4181d4bc-fdc0-4ce7-82e9-85486d6fbb6b@v4g2000hsf.googlegroups.com>


On Nov 19, 12:48 pm, Vijai Kalyan <vijai.kal..._at_gmail.com> wrote:
> Hi All,
>
> I have a question about data validation. I have been reading some
> articles that indicate that data validation should be done at the
> application level (while also having integrity constraints in the
> database) whereas other articles mention that data validation should
> be done only at the database level because that's what integrity
> constraints are for.
>
> Any for or against on these two viewpoints?
>
> Thanks,
>
> Vijai.

Where data should be validated depends on the data and the application. In many cases data should be validated by both the application and the database.

The application should usually provide all necessary edits for data being of the right type and value ranges. It should pretty well be impossible to enter orders for non-existent customers or suppliers or to enter 8 digits for a column that supports only 6 digits via online screens (web pages).

At the same time referential integrity constraints should definitely be defined in the database. This way any checks the application misses or does not include will be made by the database. Plus the database level constraints will protect the data integrity from batch and non-application data entry points. (FTP files loaded via sqlldr or batch programs) The database level integrity checks will also protect the data from many code design errors especially once the original team moves on and new people less familiar with the application take over support and enhancements.

So my answer is that both the application and the database contain integrity checking.

HTH -- Mark D Powell -- Received on Mon Nov 19 2007 - 12:25:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US