Oracle FAQ Your Portal to the Oracle Knowledge Grid

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

Re: Where to do Data Validation?

From: Mark D Powell <>
Date: Mon, 19 Nov 2007 10:25:44 -0800 (PST)
Message-ID: <>

On Nov 19, 12:48 pm, Vijai Kalyan <> 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