当前位置:网站首页>Gbase8s database for update clause
Gbase8s database for update clause
2022-06-29 12:18:00 【Like to eat radish ice cold】
When you plan to update prepared by SELECT The value returned by the statement , When accessing these values , Please be there. ESQL/C Application and in
DB-Access Use in FOR UPDATE Clause .
Preparation includes FRO UPDATE Clause SELECT sentence , Equivalent to preparing without FOR UPDATE Clause SELECT language
sentence , Then declare for the prepared statement FOR UPDATE The cursor .
FOR UPDATE Keyword notifies the database server of possible updates , Cause it to use more than accompanying Select Cursor is more strict
lock . Without this clause , You cannot modify data through a cursor . You can specify which columns can be updated .
When you are SELECT . . . FOR UPDATE Statement after declaring a cursor , You can use the with WHERE CURRENT OF Clause
UPDATE or DELETE Statement to update or delete the currently selected row . keyword CURRENT OF Reference the most recently accessed row ;
They replace in WHERE The usual conditional expression in clause . To update a row with a specific value , Your program may include the following
The statement in the column example :
EXEC SQL BEGIN DECLARE SECTION;
char fname[ 16];
char lname[ 16];
EXEC SQL END DECLARE SECTION;
. . .
EXEC SQL connect to ‘stores_demo’;
/* select statement being prepared contains a for update clause */
EXEC SQL prepare x from ‘select fname, lname from customer for update’;
EXEC SQL declare xc cursor for x;
for (;
{
EXEC SQL fetch xc into $fname, $lname;
if (strncmp(SQLSTATE, ‘00’, 2) != 0) break;
printf(“%d %s %s\n”,cnum, fname, lname );
if (cnum == 999) --update rows with 999 customer_num
EXEC SQL update customer set fname = ‘rosey’ where current of xc;
}
EXEC SQL close xc;
EXEC SQL disconnect current;
SELECT . . . FOR UPDATE sentence , image Update Cursor like , Allows you to perform those individual uses UPDATE sentence
Updates that cannot be performed , Because the decision to update and the value of the new data item can be based on the original content of the row .UPDATE
Statement cannot query the table being updated .
notes : In the cursor FETCH A normal update within the loop is not guaranteed in UPDATE Then access the updated row again .
WHERE CURRENT OF The specification will UPDATE Contact Update The cursor , And make sure that each row is updated only once , By inside
Keep a list of rows that have been updated . These lines will not be Update The cursor accesses again .
边栏推荐
- iMile 利用 Zadig 多云环境周部署千次,跨云跨地域持续交付全球业务
- Is the table queried by this EMR sparksql node ODPs?
- Dragon Book tiger Book whale Book gnawing? Try the monkey book with Douban score of 9.5
- 谷粒商城项目
- 初次使用 eolink 感受
- 易快报:我们用 Zadig 实现万次构建部署,聪明运维,释放开发生产力
- An interpretable geometric depth learning model for structure based protein binding site prediction
- 恒泰证券开户安全吗 证券排名
- 论文复现——AC-FPN:Attention-guided Context Feature Pyramid Network for Object Detection.
- Codeforces Round #803 (Div. 2)
猜你喜欢

Titanium dynamic technology: our Zadig landing Road

爱可可AI前沿推介(6.29)
![Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cycle functions [chapter]](/img/d7/f73e748ada302440326a8b1a46f916.png)
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cycle functions [chapter]

如何查看网站已经保存的密码

AUTOCAD——文字显示方式、CAD怎么直接打开天正图纸

Initial use of eolink

ERP Kingdee for preparing BOM

LM07丨细聊期货横截面策略

MATLAB Gui 实现点击按钮,打开文件对话框,导入图片功能

Intelligent trash can (IV) -- raspberry pie Pico realizes ultrasonic ranging (hc-sr04)
随机推荐
Serving millions of developers, the first techo day Tencent technology open day released 7 "lightweight" products
Artbench: the first class balanced, high-quality, clean annotated and standardized artwork generation data set
这个EMR-SparkSQL节点,他查询的表是不是ODPS的啊?
ERP Kingdee for preparing BOM
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
MIT线性代数中文笔记
Codeforces Round #803 (Div. 2)
Take another picture of cloud redis' improvement path
MySQL 主从复制原理以及流程
GBase8s数据库与 FOR UPDATE 子句不兼容的语法
模糊图片变清晰,一键双色图片,快速整理本地图片...这8个在线图片工具申请加入你的收藏夹!
ERP编制物料清单 基础
An interpretable geometric depth learning model for structure based protein binding site prediction
力扣每日一题-第31天-13.罗马数组转整数
正大期货主账户留4行情软件用的什么?
Li Kou daily question - day 31 -13 Maximum perimeter of triangle
What are outer chain and inner chain?
The blackened honeysnow ice city wants to grasp the hearts of consumers by marketing?
How to view saved passwords of websites
Pro test! Centos7 deploy PHP + spool