SQL: Oracle update from statement

Source: Internet
Author: User
I still have the habit of using SQL Server. in Oracle, the update from structure is often used. In fact, there is no from statement in Oracle.

Code
1 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 ' ; Error: ORA-00933: SQL command not properly ended Code
1 Update Hek_om_pop_lines_all
2 Set Quantity_2 = Quantity_1
3 Where 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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.