Article View: borland.public.jbuilder.database
Article #355MS SQLServer "FOR UPDATE"
From: Magnus
Date: Wed, 25 Oct 2006 19:06
Date: Wed, 25 Oct 2006 19:06
19 lines
1386 bytes
1386 bytes
Hi,
I use the below stmt to do a "lock" on the table.
It works great on JDS and MySQL but I get the following error on MS SQL
Server 2000:
e:com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE
clause allowed only for DECLARE CURSOR.
Can anyone point me in the right direction here?
TIA
---
rs = stmt.executeQuery("select path from location " +
"where compid = \'" + compId + "\' " +
"and location = \'" + location + "\' " +
"FOR UPDATE ");
Technical Details
Message-ID:
<453fb594$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1073da,b07ba128b612bb4e,start X-Google-Attributes: gid1073da,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 25 Oct 2006 15:06:12 -0400 From: Magnus <magnus_bjorkman@yahoo.com> User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.database Subject: MS SQLServer "FOR UPDATE" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.149.234.69 Message-ID: <453fb594$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1161803156 24.149.234.69 (25 Oct 2006 12:05:56 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail