Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Where to do Data Validation?
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.
As no application outlives data, you should always perform business rule checking, referential constraints and any other constraint checking there, where your data will reside: in the database.
Now, probably a lot of your customers will find it very annoying that -after filling in dozens of fields- you present them with a blanked screen, and the error line: "Invalid date; please input valid date".
They will ask 'what date, where'? Hence it may be a good idea to insert some user-friendliness and check inputs *the moment they are entered*, too.
Of course, some environments (HTML) cannot do that, so you'll have to revert to tricks - JavaScript is such a trick.
So the answer is: both. Unless you want to create a non-sellable application :)
-- Regards, Frank van Bortel Top-posting is one way to shut me up...Received on Mon Nov 19 2007 - 12:45:11 CST
![]() |
![]() |