SQL Confusion

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Oct 9 10:01:59 CDT 2007


On 9/10/07 3:51 PM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:

> It would look like this (you may notice that several things are not
> possible now)
> 
> create or replace sp_Update(tblName String,aRecid Long,UpdateFields
> as Array, UpdateValues as Array)
> 
> Begin
> build a cursor to lock the record(aRecID) of table tblName
> for i = 0 to UpdateFields.Count
> cursor.UpdateFields(i) = UpdateValue(i)
> next
> cursor.UpdateRecord()
> cursor = 0 ---> release locks
> Exception
> record_is_already_locked
> 
> End

I do not catch why not just

    UPDATE T (f1,f2,f3)
        VALUES (1,2,3)
    WHERE RecID = aRecid

?
 
> So what we TRY to do is updating a record through a stored procedure
> The first PROBLEM is that we cannot obtain a lock inside a stored
> procedure so we just must try an update statement that will fail
> (generate an exception) if somebody else already has a writelock on
> this record.
> There is currently no way to SET a lock on a record from within the
> procedure.
> So the only way of updating a record from within the procedure seems
> to be trial and error. And that is something I don't like....

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list