Ora-01779 error.

Source: Internet
Author: User

In the update optimization, considering the efficiency of the update from is relatively high, but because Oracle will check the key value, resulting in a ora-01779 error, by using BYPASS_UJVC to skip the Oracle key determination, achieve the same effect.

Example:

Update (select/* + BYPASS_UJVC */
T1.drawref,
T. oprtype,
T. bl_validation,
'F' bl_validation_new,
T. bl_msg,
T. bl_msg |
Case when (t1.drawref is null and t. oprtype = 'U') then' the transaction account number does not exist and cannot be updated ;'
When (t1.drawref is null and t. oprtype = 'D') then' the transaction account number does not exist and cannot be deleted ;'
When (t1.drawref is not null and t. oprtype = 'I') then' the transaction account number already exists and cannot be inserted ;'
End bl_msg_new
From s_bl2_con_pro_temp t
Left join s_bl2_con_pro t1
On t. drawref = t1.drawref
Where
-- T. bl_user = 134
(T. OPRTYPE <> 'n' OR t. OPRTYPE is null)
And t1.BL _ DELETED (+) = 'F'
And t1.OPRTYPE (+) in ('U', 'D', 'I ')
And t1.partition _ key (+) = '000000'
And t. partition_key = '20140901'
)
Set bl_validation = bl_validation_new,
Bl_msg = bl_msg_new
;

Commit;

The details are as follows:

When we are sure that the current condition can determine that the record is unique, and it is not the primary key, we can use two methods for processing.

1. Create a unique index

2. update (select/* + BYPASS_UJVC */a. cola va, B. colb vb from a, B where a. id = B. id) set va = vb

BYPASS_UJVC is used to determine whether to skip the Oracle key.

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.