Subject Re: [firebird-support] Re: SQL needs to be reviewd and some questions:
Author Wei Yu
--- Adam <s3057043@...> wrote:

>
> >
> > Q: Could I use SELECT UPDATE LOCK syntax to
> replace the above code?
> if
> > so how to do it and how to do unlocking?
> >
>
> update DIVISION set
> LOCKED = :PostBy
> where ID = :DivisionID;
>
> You do not need the null test, this will raise an
> exception if
> another transaction is using that ID.
>

Hmmm, I have to test null since if someone is lock
that record (locked <> null), then I definitely need
to skip and exit from the procedure. Am I missing
something? why will it raise exception if i test null?

William

=====
William, Yu




__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com