Import in Excel to Oracle using the merge into differential update database

Source: Internet
Author: User

Merge into Temp1 a
using (select ID
From (Select ID
From Temp1
where ID = ' SYSTEM00000100000010846 '
UNION ALL
Select null ID from dual)
where rownum = 1) b
On (b.id = a.id)
When matched then
Update
Set report_date = To_date (' 2014/5/22-0:00:00 ',
' Yyyy-mm-dd hh24:mi:ss '),
report_sup_id = ' gy20t0000201000015754595 ',
report_sup_name = ' Beijing Military District Taiyuan Medicinal material Supply Station 2 ',
VOUCHER = ' ',
DIGEST = ' Today 10846 ',
Borrow_value = 1000,
Loan_value =-1,
DIRECTION = ' borrowed ',
BALANCE = 2990
When isn't matched then
Insert
(ID,
Report_date,
REPORT_SUP_ID,
Report_sup_name,
VOUCHER,
DIGEST,
Borrow_value,
Loan_value,
DIRECTION,
BALANCE)
Values
(' SYSTEM00000100000010846 ',
To_date (' 2014/5/22 0:00:00 ', ' yyyy-mm-dd hh24:mi:ss '),
' gy20t0000201000015754595 ',
' Beijing Military Region Taiyuan Medicinal supplies Station 2 ',
‘‘,
' Today 10846 ',
1000,
-1,
' Borrow ',
2990)

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.