[英]Jooq update return value
I try to update rows in table and get results after.我尝试更新表中的行并在之后获得结果。 If I do
如果我做
dsl.update(TABLE)
.set(TABLE.ROW, newRow)
.where(TABLE.ROW_2.eq(
dsl.select(ANOTHER_TABLE.ID)
.from(ANOTHER_TABLE)
.where(ANOTHER_TABLE.GUID.eq(guid))
)).execute()
it returns 1. But if I do它返回 1。但是如果我这样做
dsl.update(TABLE)
.set(TABLE.ROW, newRow)
.where(TABLE.ROW_2.eq(
dsl.select(ANOTHER_TABLE.ID)
.from(ANOTHER_TABLE)
.where(ANOTHER_TABLE.GUID.eq(guid))
)).returningResult(TABLE.ROW_3).fetchOne()
it returns empty result.它返回空结果。 But I want to get TABLE.ROW_3 after update.
但我想在更新后获得 TABLE.ROW_3。 Whats the problem?
有什么问题?
Vertica doesn't support UPDATE.. RETURNING
like PostgreSQL, as can be seen in the Vertica docs: https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Statements/UPDATE.htm Vertica 不支持
UPDATE.. RETURNING
像 PostgreSQL 一样返回,如 Vertica 文档中所示: https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Statements/UPDATE.htm
The jOOQ documentation of UpdateReturningStep::returningResult
reflects this by not listing SQLDialect.VERTICA
in its @Support
annotation: UpdateReturningStep::returningResult
的 jOOQ 文档通过未在其@Support
注释中列出SQLDialect.VERTICA
来反映这一点:
@Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,ORACLE,POSTGRES,SQLSERVER})
There's currently no workaround for this.目前没有解决方法。 If you want to avoid using such API, you could use the
jOOQ-checker
module in your build to produce compilation errors whenever you use API that is not supported by VERTICA
如果您想避免使用这样的 API,您可以在构建中使用
jOOQ-checker
模块,以便在您使用 VERTICA 不支持的VERTICA
时产生编译错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.