Re: Problem in checking conditions

From: Robert Klemme <>
Date: Sun, 09 Feb 2014 12:41:54 +0100
Message-ID: <>

On 09.02.2014 10:54, Karthick Ravi wrote:

> But when i use sum(loan)!>sum(deposit) it throws an error that
> functions are not allowed in CHECK CONSTRAIN . I this case what
> should i do? Is there any alternate way to check the sum(loan) should
> be less than the sum(deposit) in a table.

CHECK constraints are per row so they cannot apply to the whole table. You'll want to read the "Concepts" document. One straight forward approach is to create another table with the sums and have them updated via trigger. Then create constraint on that table. Of course this has implications (performance etc.).


        robert Received on Sun Feb 09 2014 - 12:41:54 CET

Original text of this message