小编Pra*_*ati的帖子

从存储库中选择内容,其中 id = ? 用于更新

上述查询在 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)

java sql sql-server-2005 jdbc oracle10g

0
推荐指数
1
解决办法
2302
查看次数

标签 统计

java ×1

jdbc ×1

oracle10g ×1

sql ×1

sql-server-2005 ×1