My Oracle Support Banner

Ora-00060 When Performing Insert using WITH Clause And Table Locked (Doc ID 1250454.1)

Last updated on FEBRUARY 19, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.7 and later
Information in this document applies to any platform.

Symptoms

On production 11.1.0.7/11.2.0.1 version,

NOTE: In the images and/or the document content below, the user information and data used represents fictitious data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product.  Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.


When attempting to execute
LOCK TABLE AG_TEST_TABLE IN EXCLUSIVE MODE;


INSERT INTO AG_TEST_TABLE ( id, key_type_cd, key_field_cd, key_value , key_source_cd, start_dt, end_dt, is_active, is_Placeholder)
WITH all_keys as (
SELECT key_type_cd, key_value
FROM AG_TEST_TABLE
WHERE SYSDATE BETWEEN start_dt and NVL(end_Dt, SYSDATE)
)
SELECT rownum,
key_type_cd1,
key_field_cd1,
key_value1,
'DUMMY' key_source_cd,
SYSDATE start_dt,
to_date('31.12.9999','dd.mm.yyyy') end_dt,
'1' is_active,
'0' is_placeholder
FROM (
SELECT DISTINCT
T1.KEY_FIELD_CD1, T1.KEY_TYPE_CD1, T1.KEY_VALUE1
FROM AG_VTI_TABLE T1
WHERE T1.KEY_SOURCE_CD = 'Source1'
-- no valid master key
AND T1.KEY_TYPE_CD1 IS NOT NULL AND T1.KEY_VALUE1 IS NOT NULL
AND ( T1.KEY_TYPE_CD1, T1.KEY_VALUE1) NOT IN (
SELECT KEY_TYPE_CD, KEY_VALUE
FROM all_keys
)
-- no valid AK 1
AND ( NVL(T1.KEY_TYPE_CD2,CHR(1) ), NVL(T1.KEY_VALUE2, CHR(1)) ) NOT IN (
SELECT KEY_TYPE_CD, KEY_VALUE
FROM all_keys
)
-- no valid AK 2
AND ( NVL(T1.KEY_TYPE_CD3,CHR(1) ), NVL(T1.KEY_VALUE3, CHR(1)) ) NOT IN (
SELECT KEY_TYPE_CD, KEY_VALUE
FROM all_keys
)
-- no valid AK 3
AND ( NVL(T1.KEY_TYPE_CD4,CHR(1)), NVL(T1.KEY_VALUE4,CHR(1))) NOT IN (
SELECT KEY_TYPE_CD, KEY_VALUE
FROM all_keys
)
)
;
and the table has degree >1 then

the following error occurs.




STEPS
-----------------------
The issue can be reproduced at will with the steps indicated above

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.