惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - tangdh

个人所得税速算扣除数是怎么算的? 个人所得税税率表一(工资、薪金所得适用)(2011年9月1日起执行) PB类库网址大全 pb 函数库-打印函数 PB Send()函数应用有关数据整理 PB 函数库-数据类型检查与转换函数 DataWindow的数据管理与更新机制的研究与应用 优化你的PB程序 - tangdh - 博客园 如何复制grid类型的所选择的行的数据到系统剪切板 PB 的 error.number 列表 - tangdh 在PowerBuilder的DataWindows.ItemChanged事件中修改当前单元格值的方法 sql 收藏 浪潮财务从一套帐备份到另一套帐 酒桌上的潜规则,男人必学,女人必知 excel个人所得税计算公式 全国大学FTP站列表 使用命令行IPSec封锁端口 pb11.2 转asp.net成功 [ASP.Net 2.0] TreeView只能用XML資料的解決之道
PB开发境界 多个DW进行update
tangdh · 2010-06-01 · via 博客园 - tangdh

多个DW进行update

//菜鸟代码
dw_1.Update()
dw_2.Update()
初级代码
IF dw_1.Update() = 1 And dw_2.Update() = 1 THEN
        COMMIT;
ELSE
        ROLLBACK;
END IF
中级代码
IF dw_1.Update() = 1 THEN
        IF dw_2.Update() = 1 THEN
                COMMIT;
        ELSE
                MessageBox("提示","喝多了!")
                ROLLBACK;
        END IF
ELSE
        MessageBox("提示","喝多了!")
        ROLLBACK;
END IF
高级代码
IF dw_1.Update() = 1 THEN
        IF dw_2.Update() = 1 THEN
                COMMIT;
        ELSE
                ROLLBACK;
                MessageBox("提示","少喝点!")
        END IF
ELSE
        ROLLBACK;
        MessageBox("提示","少喝点!")
END IF
专家级代码
IF dw_1.Update(True,False) = 1 THEN
        IF dw_2.Update(True,False) = 1 THEN
                dw_1.ResetUpdate()
                dw_2.ResetUpdate()
                COMMIT;
        ELSE
                ROLLBACK;
                MessageBox("提示","没喝高啊!")
        END IF
ELSE
        ROLLBACK;
        MessageBox("提示","没喝高啊!")
END IF

多个DW进行update,有时会不能全部成功update 用事务处理时,多个DW进行update后,再COMMIT.偶然会发现前面几个DW update成功,但后面的表失败时,好像执行了COMMIT,不会rollback.

正确的写法如下:
if dw_1.update(true, false)= 1 and dw_2.update(true, false)=1 ...then
  commit;
  dw_1.resetUpdate();
  dw_2.resetUpdate();

else
  rollback;
end if