Re: Problem in checking conditions

From: Karthick Ravi <erkarthickr_at_gmail.com>
Date: Sun, 9 Feb 2014 01:54:41 -0800 (PST)
Message-ID: <58103708-375b-45c3-9bac-d09ed2b09715_at_googlegroups.com>


On Sunday, February 9, 2014 2:51:10 PM UTC+5:30, Peter Schneider wrote:
> Am 08.02.2014 20:38, schrieb Karthick Ravi:
>
> > Hello Sir,
>
> >
>
> > I'm using Oracle 10g for Educational purpose. I have only one table with five columns namely cusid,name,deposits and loan. Now when i create a check constrain using create assertion command i get error, When searching about it on web i found that create assertion command was in SQL-92 and no more in use. Was that true? can't we use assertions in Oracle 10g or Above?
>
> >
>
> > If there is any alternate way to check,
>
> > (i) The total loan provided by loan should be always less than the total deposits made.
>
> > (ii) If there is an alternate way Please provide the basic code here.
>
>
>
>
>
> In Oracle there is no "CREATE ASSERTION". You create a CHECK constraint.
>
>
>
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm#CJAEDFIB
>
>
>
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses002.htm#i1002719
>
>
>
> Regards
>
> Peter
>
>
>
> --
>
> Climb the mountain not to plant your flag, but to embrace the challenge,
>
> enjoy the air and behold the view. Climb it so you can see the world,
>
> not so the world can see you. -- David McCullough Jr.

Thank you Peter,

          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. Received on Sun Feb 09 2014 - 10:54:41 CET

Original text of this message