上述查询在 Oracle 10g 上成功运行。现在我必须使用 SQLSERVER 2005 实现相同的查询(应用程序)。
当我在 SQLSERVER 2005 中运行上述查询时,出现错误“FOR UPDATE 子句仅允许用于 DECLARE CURSOR”。
SQLSERVER 2005 支持上述查询吗?或者有什么替代方案吗?
目的:
基本上我正在更新我的应用程序中的文档。我正在使用分块更新,每次都必须将旧内容附加到新内容。
代码:
Blob bb = getDataAccess().executeScalar( "select content from Repository where id = ? for update", getId());
os = bb.setBinaryStream(startIndex + 1);
while ((read = content.read(buf)) > 0) {
os.write(buf, 0, read);
startIndex += read;
//commit every megabate or every second so upload progress is visible
//and we don't lose more than 1MB if something happens.
if (startIndex - lastStartIndex > …Run Code Online (Sandbox Code Playgroud)