My Oracle Support Banner

ORA-12060 TRYING TO CREATE A UNION ALL MATERIALIZED VIEW ON A PREBUILT TABLE (Doc ID 889205.1)

Last updated on MARCH 10, 2020

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.8 to 11.1.0.7 [Release 9.2 to 11.1]
Information in this document applies to any platform.

Symptoms

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.

Receiving ORA-12060 while creating a materialized view on a prebuilt table.

create table <MView_Table_Name> ( 
TRANSP_ID CHAR(12), 
ACCT_NUM CHAR(8), 
TRANSP_STATUS_CODE CHAR(2), 
TRANSP_TYPE_CODE CHAR(2), 
LOW_BAL_AMT CHAR(7) NOT NULL , 
REPLENISH_AMT CHAR(7) NOT NULL , 
ISSUE_DATE CHAR(10), 
SALE_DATE CHAR(10), 
APPRKG_FLAG VARCHAR2(1), 
REF_SEQ CHAR(8)) tablespace <TBS_Name>; 

Alter table <MView_Table_Name>  add primary key (TRANSP_ID); 

Create materialized view <MView_Name>
on prebuilt table
using index tablespace <Idx_TBS_Name>
refresh complete
START WITH to_date('11-Feb-2009 02:06:20 PM','dd-Mon-yyyy HH:MI:SS AM') 
NEXT sysdate + 0 
AS 
SELECT T.TRANSP_ID, 
LPAD(TO_CHAR( T.ACCT_NUM), 8,'00000000'), 
T.TRANSP_STATUS_CODE, 
T.TRANSP_TYPE_CODE, 
LPAD( TO_CHAR( T.LOW_BAL_AMT * 100),7,'0000000'), 
LPAD(TO_CHAR( T.REPLENISH_AMT * 100),7,'0000000' ), 
TO_CHAR(T.ISSUE_DATE,'MM/DD/YYYY'), 
TO_CHAR(T.SALE_DATE,'MM/DD/YYYY'), 
T.APPRKG_FLAG OPT_OUT_FLAG, 
LPAD(TO_CHAR(T.REF_SEQ),8,'00000000') 
FROM <Table_A> T, <Table_B> A 
WHERE A.ACCT_TYPE_CODE in ('01','03','04') 
AND A.ACCT_STATUS_CODE in ('01','02','03','04') 
AND A.ACCT_NUM = T.ACCT_NUM 
AND T.TRANSP_STATUS_CODE IN ('01','02','04','05') 
AND NVL(T.TRANSP_CLOSED,'N') != 'Y' 
union all 
SELECT T.TRANSP_ID, 
LPAD(TO_CHAR( T.ACCT_NUM), 8,'00000000'), 
T.TRANSP_STATUS_CODE, 
T.TRANSP_TYPE_CODE, 
LPAD( TO_CHAR( C.ACCT_THRESH_AMT * 100),7,'0000000'), 
LPAD(TO_CHAR( C.ACCT_REPL_AMT * 100),7,'0000000' ), 
TO_CHAR(T.ISSUE_DATE,'MM/DD/YYYY'), 
TO_CHAR(T.SALE_DATE,'MM/DD/YYYY'), 
T.APPRKG_FLAG OPT_OUT_FLAG, 
LPAD(TO_CHAR(T.REF_SEQ),8,'00000000') 
FROM <Table_A> T, <Table_B> A, <Table_C> C 
WHERE A.ACCT_TYPE_CODE = '02' 
AND A.ACCT_STATUS_CODE in ('01','02','03','04') 
AND A.ACCT_NUM = T.ACCT_NUM 
AND A.ACCT_NUM = C.ACCT_NUM 
AND T.TRANSP_STATUS_CODE IN ('01','02','04','05') 
AND NVL(T.TRANSP_CLOSED,'N') != 'Y';

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

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