2007-04-03
oracle merge into 10G增强
关键字: sql
http://www.oracle-base.com/articles/10g/MergeEnhancements10g.php
如果在9i中执行以下sql将报错:ora-00905:missing keyword
在10G 中:The MATCHED and NOT MATCHED clauses are now optional making all of the following examples valid.
如果在9i中执行以下sql将报错:ora-00905:missing keyword
Merge Into card a Using etl_cardinfo b On (a.card_number = b.card_no) WHEN MATCHED Then Update Set a.open_date=b.issue_date,a.card_limit=b.card_limit ;
在10G 中:The MATCHED and NOT MATCHED clauses are now optional making all of the following examples valid.
-- Both clauses present.
MERGE INTO test1 a
USING all_objects b
ON (a.object_id = b.object_id)
WHEN MATCHED THEN
UPDATE SET a.status = b.status
WHEN NOT MATCHED THEN
INSERT (object_id, status)
VALUES (b.object_id, b.status);
-- No matched clause, insert only.
MERGE INTO test1 a
USING all_objects b
ON (a.object_id = b.object_id)
WHEN NOT MATCHED THEN
INSERT (object_id, status)
VALUES (b.object_id, b.status);
-- No not-matched clause, update only.
MERGE INTO test1 a
USING all_objects b
ON (a.object_id = b.object_id)
WHEN MATCHED THEN
UPDATE SET a.status = b.status;
发表评论
- 浏览: 394578 次
- 性别:

- 来自: 上海

- 详细资料
搜索本博客
我的相册
Gmail
共 8 张
共 8 张
最新评论
-
JIRA不完全手册
楼主,发一份完整的资料给我吧 xwj1003@yahoo.com.cn
-- by volking -
java encoding参考
Good ,thanks.
-- by zuowei -
有多少异常可以重来
我今天也遇到这个问题,才搜到这个帖子~ 还没有解决,等恢复哦
-- by javamanlcy007 -
有多少异常可以重来
这个错误解决了,又抱了别的错误~
-- by iceworld4143 -
有多少异常可以重来
解释不太懂,我也遇到这个问题了,可是我没用ant。 :cry: 等回 ...
-- by iceworld4143






评论排行榜