初级的方法是使用一个游标对表进行扫描,并为每一行执行一个定位的更新语句。
The naive approach USES a cursor to scan the table and execute a positioned update statement for each row.
例如,您可以遍历项目,并基于当前游标位置更新其状态(参见清单5)。
For example, you can loop through projects and update their statuses based on the current cursor position (see Listing 5).
JDBCAPI的灵活性还允许您创建一个可以通过编程的方法来使用的游标,用于通过发出相应的SQL命令执行定位更新和删除。
The flexibility of the JDBC API also permits you to create a cursor that you can use programmatically to perform positioned updates and deletes by issuing the appropriate SQL commands.
关键是准备好的语句中的sql语句会引用游标的当前位置,所以您可以多次执行它,并更新不同的行。
The key is that the SQL statement in the prepared statement references the current position of the cursor, so you can execute it multiple times and update different rows.
当检测到一个潜在的更新目标时,联邦系统避免使用块读取特性,以维护远程游标的位置。
When it detects a potential update target, the federated system avoids using the block fetch feature in order to maintain the remote cursor position.
对于行集游标,JDBC1定位更新语法必须知道行集的存在。
For rowset cursors, the JDBC 1 positioned update syntax needs be aware of the rowset.
下一步是执行适当的SQL查询来构造可更新的游标,方法为根据先前的描述使用 FORUPDATE子句。
The next step is to execute the appropriate SQL query to construct your updateable cursor, which requires using the FOR UPDATE clause as described earlier.
可更新的游标(通过JDBC)。
上述这些游标都很有用,但是,直接操纵游标的实际价值在于在特定位置更新数据库的能力。
All of this is fine, but the real value of directly manipulating a cursor is the ability to update the database at a particular position.
要查看已更新的行,必须关闭该游标并发出一个查询来显示新结果。
To view the updated row, you must close the cursor and issue a query to display the new results.
在远程过程上不支持可更新、可持有和可滚动的游标。
Updatable, holdable, and scrollable cursors on remote procedures are not supported.
不可重复的读取:A 1中重新打开的游标检索a 2对符合资格的行的更新。
Non-repeatable reads: The reopened cursor in A1 retrieves updates of A2 on qualifying rows.
必需——否。如果这个参数是null,则使用可更新的游标来修改所选的列。
Essential - No. If this argument is null, then updatable cursors are used to modify the selected columns.
如果该参数为null,则使用可更新的游标来修改所选的列。
If this argument is null, then updatable cursors are used to modify the selected columns.
如果该参数为null,则使用可更新的游标来修改所选的列。
If this argument is null, then updatable cursors are used to modify the selected columns.
应用推荐