Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Avoiding any locks in SQL Servers - read and understand....its magic.
VC wrote:
>
> Hello Galen,
>
> "Galen Boyer" <galenboyer_at_hotpop.com> wrote in message
> news:ur7xmii44.fsf_at_standardandpoors.com..
> > On 26 Jan 2004, boston103_at_hotmail.com wrote:
> >
> > > The constraint is right there, in the statement itself:
> > >
> > > update t1 set amount=amount-80 where (select
> > > t1.amount+t2.amount from t1 join t2 on t1.id=t2.id) > 0;
> >
> > How is the constraint in your statement? You have only
> > restricted the selected rows.
>
> As I've alredy responded to others, the constraint is just a condition and
> since Oracle does not provide database constraints, a programmer has
> to code them manually as I did in my trivial example.
>
> In order to mimic an 'automatic' database level constraint, the condition
> above can be enforced via a trigger throwing an exception when the condition
> evaluates to false.
Does a VIEW and WITH CHECK OPTION work for Oracle? That construct provides an enforceable constraint.
-- Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)Received on Mon Jan 26 2004 - 18:11:08 CST
![]() |
![]() |