PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Seaman, Mark" <Mark dot Seaman at vtmednet dot org>
Subject: RE: select... for update
Date: Oct 2 2000 6:29PM

Matt,
	I think the "holdlock" option of the SELECT statement does what you
want to do.

Mark Seaman
-----Original Message-----
From: Matthew E Studley [mailto:matthew@coms.com]
Sent: Monday, October 02, 2000 2:04 PM
To: SybPerl Discussion List
Subject: select... for update


ladies and gents

quick transact sql q. if i may...

in oracle I can do something like this:

begin
  select col1 into var1 from table1 FOR UPDATE;
  .. some stuff
  update table1 set col2 = new_value where col1 = var1;

  error handling commit / rolllback etc

end

the FOR UPDATE bit gives me a lock on this data row.  

has anybody got any pointers on how I acquire a lock with a select
statement in transact sql? 

thanks for any help...

matt 

Matthew Studley
_____________________________________________________
Technical Architect		coms.com 
				126-128 New Kings Rd
+44 (0) 7080 810 101		London  SW6 3LZ.