您的位置:首页 > 数据库 > Oracle

sql:关于Oracle的update from语句

2009-10-13 12:58 441 查看
[align=left] 还是带有SQL Server的习惯,在Oracle中经常使用update from结构,事实上Oracle中是不存在from语句的。

[/align]

update hek_om_pop_lines_all
2 set quantity_2 = quantity_1
3 from hek_om_pop_lines_all l, hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
4 where l.header_id = h.header_id
5 and h.sold_to_org_id = ctl.customer_id
6 and h.flow_status = 'enter'
7 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
8 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
9 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
10 and application = 'POP';
[align=left] [/align]
[align=left]error:ORA-00933:SQL Command not properly ended[/align]
[align=left] [/align]

update hek_om_pop_lines_all
2set quantity_2 = quantity_1
3where header_id in (select h.header_id
4 from hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
5 where h.flow_status = 'enter'
6 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
7 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
8 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
9 and application = 'POP'
10 and h.sold_to_org_id = ctl.customer_id);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐