dbTalk Databases Forums  

Locking a table for exclusive use

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Locking a table for exclusive use in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bill Skelton
 
Posts: n/a

Default Locking a table for exclusive use - 08-06-2009 , 05:14 PM






I need to be able to lock a table for exclusive use AND report to other
users attempting to access, for any reason, the same table. For example,
Betty opens the table and is using it. Tammy tries to use the same table
and is locked out with a message "Table in use by Betty." Whereby Tammy can
cancel and resume work.

I would appreciate any ideas.

Thanks,
--
Bill Skelton

Reply With Quote
  #2  
Old   
R. Pods
 
Posts: n/a

Default Re: Locking a table for exclusive use - 08-07-2009 , 02:13 AM






Bill,

you might want to use "LOCK TABLE <yourTable> IN EXCLUSIVE MODE". If an
error occurs call SA_LOCKS tp check if another user already locked the
table.

LOCK TABLE will work with SQLA 7 and higher.

Cheers
Reimer

Bill Skelton wrote:
Quote:
I need to be able to lock a table for exclusive use AND report to other
users attempting to access, for any reason, the same table. For example,
Betty opens the table and is using it. Tammy tries to use the same table
and is locked out with a message "Table in use by Betty." Whereby Tammy can
cancel and resume work.

I would appreciate any ideas.

Thanks,

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.