Materialized view problem ORA-00904: "from$_subquery$_ error
Hello everyone,
I've created data warehouse star schema and I'm trying to set up materialized view. DBMS_MVIEW.EXPLAIN_MVIEW passes and also the select query passes and is executed with no problems but when I try to CREATE MATERIALIZED VIEW... then error ORA-00904: "from$_subquery$_003"."SERVICE_ID_2_2": invalid identifier pops-up. How does Oracle 9i (9.2.0.1.0) managed to do this ? How to make it to work ?
This is the query, and the schema:
CREATE MATERIALIZED VIEW analiza_profitabilnosti
BUILD IMMEDIATE
REFRESH FAST
ON COMMIT
AS
select
GROUPING_ID(t.y,t.q,t.m,t.w,t.d,s.service_type,s.service_id,c.customer_category) as g_id,
t.y, t.q, t.m, t.w, t.d,
s.service_type , s.service_id ,
c.customer_category ,
COUNT(*) as c_star,
SUM(cost) cost, COUNT(cost) c_cost,
SUM(number_of_units) number_of_units, COUNT(number_of_units) as c_number_of_units
from fact f
inner join timeline t on f.datum = t.datum
inner join service s on f.service_id = s.service_id
inner join customer_category c on f.customer_category=c.customer_category
group by
ROLLUP(t.y, t.q, t.m, t.w, t.d),
ROLLUP(s.service_type, s.service_id),
ROLLUP (c.customer_category)
and the schema:
FACT (
DATUM DATE,
HOST_ID NUMBER,
SERVICE_ID NUMBER (5),
CALLED_PREFIX_ID NUMBER (10),
CUSTOMER_CATEGORY NUMBER,
TRAFIC_PERIOD_ID NUMBER (5),
CALL_DURATION NUMBER,
COST NUMBER,
NUMBER_OF_UNITS NUMBER,
NUMBER_OF_CALLS NUMBER)
TIMELINE (
Y VARCHAR2 (5),
Q VARCHAR2 (5),
M VARCHAR2 (5),
W VARCHAR2 (5),
D VARCHAR2 (5),
DATUM DATE NOT NULL)
SERVICE (
SERVICE_ID NUMBER (5) NOT NULL,
SERVICE_CODE VARCHAR2 (15) NOT NULL,
SERVICE_NAME VARCHAR2 (63),
SERVICE_TYPE NUMBER (5),
SERVICE_TYPE_CODE VARCHAR2 (4) NOT NULL,
S_ID NUMBER (5))
CUSTOMER_CATEGORY (
CUSTOMER_CATEGORY_NAME VARCHAR2 (65) NOT NULL,
CUSTOMER_CATEGORY NUMBER NOT NULL)
Thanks,
Igor
Yes, thank you. I suspected that version is problem, and patch 9.2.0.6 helped. It works under 9.2.0.6
Similar Messages
-
Create Materialized View based on Results from LDAP Query
Hi -- I'm trying to create a materialized view based on results from an LDAP query. Unfortunately, it looks like a materialized view can't be created based on a stored procedure, which is where the LDAP results are obtained (using nested loops).
Does anyone have any idea how to do this without first kicking off a stored procedure that populates a temp table which would be used to create the materialized view? I'm trying to minimize the steps that the DBA's will need to go through when refreshing this new view.
Thanks,
~ChristineCan you give us more details about the stored procedure you're calling. It will help to know what parameters are involved and what data types they are.
Off the top of my head though it looks like, at the very least, you would need a stored function that calls the stored procedure. I don't think there is any way to call stored procedures from CREATE ... commands. If you're going to create a stored function anyway ... well, you might as well just create a procedure that inserts values into a regular table instead of fussing with functions and materialized views. You'll probably want to schedule your new procedure to run periodically since it sounds like you'll need the values refreshed from time to time. -
Help on Merge Statement ,I got 'ORA-00904: invalid column name' Error
Pls help
In Oracle 9i i implement the following qry
MERGE INTO jobs A
USING (select order_no,jOB_SEQ_NO from jobs_dlt) B
ON (A.ORDER_NO = B.ORDER_NO and A.JOB_SEQ_NO =B.JOB_SEQ_NO )
WHEN MATCHED THEN
UPDATE SET
A.ORDER_NO= B.ORDER_NO ,
A.JOB_SEQ_NO= B.JOB_SEQ_NO
WHEN NOT MATCHED THEN
INSERT (
A.JOB_SEQ_NO ,
A.ORDER_NO
VALUES (
B.JOB_SEQ_NO ,
B.ORDER_NO
but i got 'ORA-00904: invalid column name' Error
JOBS table Contain the above Column
how i implement the Merge Statment
Thanks in advance
By
SekarI seem to recall this error being spuriously (well unhelpfully) thrown if you tried to UPDATE a key that you used in the ON clause, but I could be mistaken.
For us to recreate this you would need to supply the exact version and scripts to create the tables in question. -
Fast Refresh Nested Materialized View problem in ORACLE 9i 9.2.0.7
Hello
My problem is in creating fast refresh nested materialized view in oracle 9i
In below is an example of my problem
( I need to say when I run this example in Oracle 11g all things is OK )
create table ali.alitest1(id number primary key,n1 number,n2 number);
create table ali.alitest2(id number primary key,n3 number);
CREATE MATERIALIZED VIEW LOG ON ali.alitest1 WITH ROWID,PRIMARY KEY ,SEQUENCE
(n1,n2)
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON ali.alitest2 WITH ROWID,PRIMARY KEY ,SEQUENCE
(n3)
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW ali.alitest1_mv
REFRESH WITH PRIMARY KEY FAST
AS
select id,n1 from ali.alitest1;
CREATE MATERIALIZED VIEW LOG ON ali.alitest1_mv WITH ROWID,PRIMARY KEY ,SEQUENCE
(n1)
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW ali.alitest2_mv
REFRESH WITH PRIMARY KEY FAST
AS
select t1.id,t1.n1,t2.n3,t1.rowid "t1_rowid",t2.rowid "t2_rowid" from ali.alitest1_mv t1,ali.alitest2 t2 where t1.id=t2.id;
SQL Error: ORA-12053: this is not a valid nested materialized view
12053. 00000 - "this is not a valid nested materialized view"
*Cause: The list of objects in the FROM clause of the definition of this
materialized view had some dependencies upon each other.
*Action: Refer to the documentation to see which types of nesting are valid.
do you know what is problem ?
thanksTake look for this link :
http://rwijk.blogspot.com/2009/08/fast-refreshable-materialized-view.html -
Create materialized view get ora-00998 error cause by subquery
hi all,
my create statement as follow,
create materialized view MV_DM_DIM_DEALER01
Build deferred
Refresh complete
ON DEMAND
Enable query rewrite
as
select a.dealer_no,a.sk_period from DM_DIM_DEALER a
where A.SK_PERIOD=201210 and a.dealer_no in (select dealer_No from dm00_fav_dealer)
ORA-00998: must name this expression with a column alias
so what's the problem?
thx all>
my create statement as follow,
create materialized view MV_DM_DIM_DEALER01
Build deferred
Refresh complete
ON DEMAND
Enable query rewrite
as
select a.dealer_no,a.sk_period from DM_DIM_DEALER a
where A.SK_PERIOD=201210 and a.dealer_no in (select dealer_No from dm00_fav_dealer)
ORA-00998: must name this expression with a column alias
so what's the problem?
>
Well since the error is 'ORA-00998: must name this expression with a column alias' you might try naming your expressions with aliases
select a.dealer_no dealer_no,a.sk_period sk_period from DM_DIM_DEALER a -
Create materialized view with ora-12054 error
Oracle 10g R2 on AIX 5.3L
I create a script (with help of EM) for a materilaized view
CREATE MATERIALIZED VIEW "BAANDB"."R2_MV"
TABLESPACE "USERS" NOLOGGING STORAGE ( INITIAL 128K) USING INDEX TABLESPACE "BAANIDX" STORAGE ( INITIAL 256K)
REFRESH FORCE ON COMMIT
ENABLE QUERY REWRITE AS
SELECT CM.ROWID c_rid, PC.ROWID p_rid, CM."T$CWOC", "T$EMNO", CM."T$NAMA", CM."T$EDTE", PC."T$PERI", PC."T$QUAN", PC."T$YEAR", PC."T$RGDT" From BAANDB.TTPPPC235201 PC RIGHT OUTER JOIN BAANDB.TTCCOM001201 CM Using (T$EMNO)
but I got error
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
acooding to the oerr
// *Cause: The materialized view did not satisfy conditions for refresh at
// commit time.
// *Action: Specify only valid options.
what dose it mean? both my master tables are not IOT and are locale ones. It seems that only changing to ON DEMAND works. If I use the "REFRESH FORCE START ..NEXT", it also failed.
I have created the materalized view logs with rowid on each master table. I think my script met every prequirement of ON COMMIT.
table owner has "on commit refresh" privilegeAfter googling on line, someone mentioned that for "ON COMMIT" on join tables, we have to use th old OUTER JOINT syntax (+) on WHERE. The new "outer joint" in FROM clause won't work.
I tested it, it seemed to be true. -
Materialized view, problem in selecting a particular field
Hi,
can anyone please help me with this issue.
I have table which contains data for 3 different years. It usually contains data for the current year, the next year and the previous year i.e the calender current year.
YEAR TL JN Q
2006 1 1 30
2007 1 1 6
2008 1 1 4
2006 1 2 5
2008 1 2 4
This is how my table looks like. For this table i have created a view which looks like this
TL JN Q1 Q2 Q3
1 1 30 6 4
1 2 5 50
The view is a summary for the table.
The problem now is that the Master table on which the view is based keeps getting updated. In some cases it may so happen that the table can contain data for a year other than the calender current year, previous year and next year.
In this case how do i identify the year to create the view.
For example the table can get populated with records for the year 1999, in this case how can i identify the year .
This is the code i have written to create the view
create view vw_summary(TL,JN,Q1,Q2,Q3)
AS SELECT TL.,JN,
MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY'),Q,NULL)Q1,
MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY')-1,Q,NULL))Q2,
MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY')+1,Q,NULL))Q3
FROM TABLE GROUP BY TL,JY
CAN ANYONE PLEASE HELP ME.?
I am creating a materialized view for the tableone more opint to be added is that inside this procedure, i am checking for athe value of column "FLAG" in an other table param. if this flag is set to Y then i wil populate the table(on which the view is based) according to the parameter passed to the procedure. But if the flag value in the table params is set to N then i am suppose to check an other column called ACHYR in the table params. This column holds a year value say 1999.
In this case the procedure should populate the table with the records for the year 1999.
But how do I check this parameter in the view? -
Materialized view issue ORA-12052
Hi All,
I'm currently trying to create a MV using Fast refresh method.
and I'm getting the following error:
ORA-12052:
cannot fast refresh materialized view string.string
Cause: Either ROWIDs of certain tables were missing in the definition or the inner table of an outer join did not have UNIQUE constraints on join columns.
Action: Specify the FORCE or COMPLETE option. If this error is got during creation, the materialized view definition may have be changed. Refer to the documentation on materialized views.
I'm trying to create the Unique constraints required. Could anybody help me with this?. Which are the "inner tables of an outer join"?
I have also created the MVs logs with rowid, but also nothing happend.
I' ve created a Unique constraint that includes all the fields of the ourter joins. Nothing happend either.
Thi is the MV script:
'CREATE MATERIALIZED VIEW MVIEW1
USING INDEX
REFRESH ON DEMAND FAST
WITH rowid
DISABLE QUERY REWRITE AS
SELECT fp.FINAL_AMOUNTFIXED,
fp.FINAL_FPRATE,
fp.updated_rate,
fp.gsd_rate,
fp.nongsd_rate,
fp.AMT_CD,
fp.AMT_CD_ADJ1,
fp.AMT_CD_ADJ2,
fp.AMT_LC,
fp.AMT_LC_ADJ1,
fp.AMT_LC_ADJ2,
fp.ASSIGNMENT_STATUS,
fp.CURRENCY,
fp.DOLLARS,
fp.FORECAST_REVENUE_STATUS,
fp.GUID,
NVL(fp.HOURS,0) HOURS,
fp.ID,
fp.JOB_LEVEL,
fp.PJR_AMT_CD,
fp.PJR_HOURS_VALUE,
fp.PJR_LC,
fp.PJR_RATE,
fp.PJR_RATE_VALUE,
fp.PROJECT_COST_CENTER,
fp.PROJECT_COST_CENTERTXT,
NVL(cust.project_manager,fp.project_manager) project_manager,
NVL(cust.project_name,fp.project_name) project_name,
fp.PROJECT_NUMBER,
fp.PROJECT_ORGANIZATION,
NVL(cust.project_status,fp.project_status) project_status,
NVL(cust.project_type,fp.project_type) project_type,
NVL(fp.RATE,0) Rate,
fp.RATE_ADJ1,
fp.RATE_ADJ2,
fp.RATE_LEVEL,
fp.REPORT_DATE_ID,
fp.REPORT_DESCRIPTION,
fp.RESOURCE_COST_CENTER,
fp.RESOURCE_COST_CENTERTXT,
fp.RESOURCE_COUNTRY,
fp.RESOURCE_NAME,
fp.RESOURCE_ORGANIZATION,
fp.RESOURCE_TYPE,
fp.REVENUECOST_TYPE,
fp.ROLE_END_DATE,
fp.ROLE_NAME,
fp.ROLE_START_DATE,
fp.TAB,
fp.TASK_NUMBER,
fp.TPRATE_TP,
fp.WAR,
fp.WE_DATE_ID,
fp.WEEK,
fp.WORK_TYPE,
fp.PJR_FF_DIFF_MONTH,
fp.PJR_FF_DIFF_QTR,
NVL(fp.PJR_WOW,0) WOW,
fp.PJR_WOW_HRS,
fp.REMOVED_BY_ADJUSTMENT,
fp.PICK_FOR_WRITEBACK,
fp.DRAFT_REV_NUM,
fp.DRAFT_INV_NUM,
NVL(pca.country,fp.PROJECT_COUNTRY) Country,
NVL(cust.customer_id,NVL(fp.CUSTOMER_NUMBER,'TBD')) Customer_ID,
NVL(cust.CUSTOMER_NAME,NVL(fp.CUSTOMER_NAME,'TBD')) Customer_Name ,
fp.ITEM_DATE,
fp.REVENUE_CC,
fp.EXPLANATION,
fp.REPORT,
fp.REPORT_ADJUSTMENT,
fp.REPORT_ADJ1,
fp.REPORT_ADJ2,
fp.JE_DESCRIPTION,
pca.REGION_HQ_TIERLAST_CODE,
pca.MANAGER_FIELD_TIERLAST_CODE,
pca.SPECIALTY_HQ_TIERLAST_CODE,
pca.SECTOR_HQ_TIERLAST_CODE,
rca.REGION_HQ_TIERLAST_CODE,
rca.MANAGER_FIELD_TIERLAST_CODE,
rca.SPECIALTY_HQ_TIERLAST_CODE,
rca.SECTOR_HQ_TIERLAST_CODE,
pca.VERTICALS_SUB_LOB,
pca.MISC_GROUP ,
rca.VERTICALS_SUB_LOB,
rca.MISC_GROUP ,
fp.gl_date,
fp.pjr_wow_rate ,
fp.created_by,
fp.created_on,
NVL(fp.TOTAL_FUNDING,0) TOTAL_FUNDING,
NVL(fp.INCEPTION_TO_BURN,0) INCEPTION_TO_BURN,
NVL(fp.AVAILABLE_FUNDING,0) AVAILABLE_FUNDING,
NVL(fp.FORECAST_AMT,0) FORECAST_AMT,
cust.pop_date,
fp.COMMENTS_WOW_PROJ,
fp.COMMENTS_PAPER_CONFIRM,
rep.LOOKUP_CODE,
rep.NAC_SORTING1,
fp.ACTION_TO_CLOSE,
NVL(fp.NEGATIVE_BACKLOG,0) NEGATIVE_BACKLOG,
fp.SALES_REP,
fp.FORECAST_DATE,
pca.NAC_RES_TYPE_3,
rca.NAC_RES_TYPE_3
FROM FACT_PJR fp,
COSTCENTER_ATTRIBUTES pca ,
COSTCENTER_ATTRIBUTES rca,
wb_customer_lookups cust,
XXAPX_LOOKUPS rep
WHERE fp.revenue_cc = pca.LEAF_CC(+)
AND fp.RESOURCE_COST_CENTER = rca.LEAF_CC(+)
AND fp.project_number = cust.project_number(+)
AND fp.REPORT_ADJ2 = rep.VALUE(+)
AND rep.LOOKUP_TYPE = 'NAC_WB_PHASE2';'
Edited by: 859267 on May 3, 2012 11:51 AMPlease edit your post and surround the code with code tags. See 'Are there any useful formatting options not shown on the sidebar?' in the FAQ.
Also provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION). -
Hi all,
while refreshing MV I have the following error any idea why ?
SQL> exec dbms_mview.refresh('ACCT_STMT_MV','c');
BEGIN dbms_mview.refresh('ACCT_STMT_MV','c'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO'
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
ORA-06512: at line 1RegardsTry:
ALTER TABLESPACE {YourUndoTS} ADD DATAFILE '...etc...';or
ALTER DATABASE DATAFILE '{YourUndoDatafile} RESIZE 10240M; -
Getting ORA-00904 from various SPARQL statements
Hi,
I am currently working on a couple of Java services which offer access to semantic information using Jena. I have implemented two possible adapters so far, one "feeds" from an owl-file directly, one from an Oracle 11g (semantic technologies).
In both cases, I use SPARQL SELECT and CONSTRUCT statements for my queries. Querying the owl-file-based adapter with these statements, everything works fine. querying the Oracle adapter, I often get the following stacktrace:
Caused by: java.sql.SQLException: ORA-00904: "TYPE": ungültiger Bezeichner
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:352)
at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:315)
at oracle.spatial.rdf.client.jena.OracleSemQueryPlan.executeBindings(OracleSemQueryPlan.java:431)
... 65 more
The SELECT statement used is:
==============
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?type ?label ?comment
WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?type .
OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:label ?label .
FILTER(langMatches(lang(?label),'de') || (!langMatches(lang(?label),'*'))) . }
OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:comment ?comment .
FILTER(langMatches(lang(?comment),'de') || (!langMatches(lang(?comment),'*'))) }
==============
The generated SELECT clause is:
SELECT type$RDFVTYP, type$RDFLTYP, type$RDFLANG, type$RDFCLOB, decode(type$RDFVTYP, 'BLN', ('_:'||substr(type,instr(type,'m',4)+1)), type) type
FROM table(sdo_rdf_match('(<http://www.demo-uri.com/test.owl#demoInstance> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type) ', sdo_rdf_models('DEMO_MODEL'), sdo_rdf_rulebases('OWLPRIME'), null, null, NULL,' '))
I am really grateful for any advise! A simple statement like
[...]WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?type }
works fine.
Best,
DamianThanks for the reply.
I have changed the statement according to your advice:
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?typ ?lbl ?cmnt
WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?typ .
OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:label ?lbl .
FILTER(langMatches(lang(?lbl),"de") || (!langMatches(lang(?lbl),"*"))) . }
OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:comment ?cmnt .
FILTER(langMatches(lang(?cmnt),"de") || (!langMatches(lang(?cmnt),"*"))) }}
but still the same stacktrace :(
Caused by: java.sql.SQLException: ORA-00904: "TYP": ungültiger Bezeichner
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:352)
at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:315)
at oracle.spatial.rdf.client.jena.OracleSemQueryPlan.executeBindings(OracleSemQueryPlan.java:431)
... 65 more
Edited by: user13170651 on 22.09.2010 02:32 -
Ora-00604 and Ora-00904 in a With Clause
Hi:
If I use a âleft outer joinâ in the then following SQL I get a result set, but when I use a âfull outer joinâ I get ora-00604 and ora-00904. Please let me know why this is happening?
Full Join Example:
with XYZ as (
select tp.field1 as APID1
,pay.field2 as APAMT1
from Table1 tp join table2 pay on tp.id = pay.id
where rownum < 10
, XYZ2 as (
select Nvl(pd.field1,0) as PID
, pd.field2 as PAMT
from Table1 tp join table3 pd on tp.id = pd.id
where tp.field1 = -1
select COALESCE(XYZ.APID1, xyz2.PID,0)as PNM
, NVL(XYZ.APAMT1, 0) as XYZAMT
, NVL(xyz2.PAMT, 0) as XYZ2AMT
from XYZ full outer join XYZ2 on PID = APID1
Note: the SQL in XYZ2 returns 0 rows.
The error I get is :
ORA-00604: error occurred at recursive SQL level 1
ORA-00904: "from$_subquery$_003"."QCSJ_C003008_12": invalid identifier
Left Outer Join Example (This returns result):
with XYZ as (
select tp.field1 as APID1
,pay.field2 as APAMT1
from Table1 tp join table2 pay on tp.id = pay.id
where rownum < 10
, XYZ2 as (
select Nvl(pd.field1,0) as PID
, pd.field2 as PAMT
from Table1 tp join table3 pd on tp.id = pd.id
where tp.field1 = -1
select COALESCE(XYZ.APID1, xyz2.PID,0)as PNM
, NVL(XYZ.APAMT1, 0) as XYZAMT
, NVL(xyz2.PAMT, 0) as XYZ2AMT
from XYZ left outer join XYZ2 on PID = APID1
Note: the SQL in XYZ2 returns 0 rows.
Thank you,Please refer to Doc ID: 311230.1 which has detailed information about these errors.
-
ORA-00600: internal error when delete master rows in a materialized view
I have a materialized view in 11g2 on Redhat 5, defined asCREATE MATERIALIZED VIEW mv_idty
PARALLEL BUILD IMMEDIATE REFRESH FAST ON COMMIT ENABLE QUERY REWRITE AS
select IDTY_NAME_FIRST,IDTY_NAME_MIDDLE,IDTY_NAME_LAST,IDTY_NAME_SUFFIX,IDTY_SSN,
IDTY_DR_LIC_NUM,IDTY_DR_LIC_STA,x.person_id,i.rowid i_rowid,x.rowid x_rowid
from idty i,person_x_idty x where x.idty_id=i.idty_id; I deleted a few rows from the master tables and get error13:58:48 SQL> delete idty where idty_id like 'test_row%' ;
7 rows deleted.
13:58:52 SQL> commit;
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00600: internal error code, arguments: [kkzfrfajv_markdml-1], [], [], [], [], [], [], [], [], [], [], [] I have other materialized views and they all delete master OK. This is the simplest one but causes problem. HELP!
Edited by: user13148231 on Aug 11, 2010 5:45 PMChecked note 743766.1. It is not 100% relevant as it is about import, but the query is usefulselect sowner, vname, mowner, master from sys.snap_reftime$It reveals the materialized view some how based on other schema.
Recreate the materialized view. problem solved. -
Synonym problem with external table in materialized view
I have a materialized view that includes selects on two external tables.
However, no matter how I try to access the external tables, the creation fails with a "Synonym Translation Is No Longer Valid" (ORA-00980) error.
This happens even when I replace the tablename with the full table name, including the link.
I can create a view just fine, but if I then try something like CREATE MATERIALIZED VIEW mvw_my_view AS SELECT * FROM vw_my_view (where vw_my_view is the view in question), it still throws the Synonym Translation exception.00980, 00000, "synonym translation is no longer valid"
// *Cause: A synonym did not translate to a legal target object. This
// could happen for one of the following reasons:
// 1. The target schema does not exist.
// 2. The target object does not exist.
// 3. The synonym specifies an incorrect database link.
// 4. The synonym is not versioned but specifies a versioned
// target object.
// *Action: Change the synonym definition so that the synonym points at
// a legal target object.It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds. -
Error in Log file from a scheduled materialized view
Hi
Getting the following errors in the alert_xe.log file when refreshing a materialized view. The data from the materialized view seems fine.
ORA-12012: error on auto execute of job 1
ORA-12008: error in materialized view refresh path
ORA-01555: snapshot too old: rollback segment number 41 with name "_SYSSMU41$" too small
ORA-02063: preceding line from HRLIVE
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2566
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2779
ORA-06512: at "SYS.DBMS_IREFRESH", line 685
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
This is with XE Apex 4.1
Thanks for any suggestionsThanks - tried google and changing undo_retention but no luck.
We noticed something very odd...
TABLESPACE_NAME AUT
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\USERS.DBF
USERS YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\SYSAUX.DBF
UNDOTBS1 YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF
SYSAUX YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
SYSTEM YES
The file SYSAUX.DBF has table space UNDOTBS1
and file UNDOTBS1.DBF has table space SYSAUX
This looks the wrong way around.
Any ideas how this could have happened and how this can be changed?
Thanks & regards
Edited by: rw on Jan 18, 2012 8:32 AM -
Ora-00904 when creating a view
Hello everyone,
I'm trying to create a view based on 6 tables, and I'm getting an ORA-00904: Invalid column name error. I also tried to do a basic select * from table_name and inserted one of the restrictions in my where clause and am getting the same error. I've checked and re-checked the column names in my script.
Can anything else be causing this error?
RoseCREATE OR REPLACE VIEW GEN_VISTA_VW (PERSON_ID,
LAST_NAME, MIDDLE_NAME, FIRST_NAME, ADDRESS, LINE2, LINE3, COMMUNITY, POSTAL_CODE, HOME_PHONE, BUS_PHONE, PROVINCE, HOME_SCHOOL_ID, EMPNO, POSITION, REG_NUMB)
AS (SELECT
PERSON.PERSON_ID,
PERSON.LAST_NAME,
PERSON.MIDDLE_NAME,
PERSON.FIRST_NAME,
PERADDR.LINE1,
PERADDR.LINE2,
PERADDR.LINE3,
PERADDR.CITY,
PERADDR.ZIP,
PERPHONE.PHONE_NO,
TBLLOC.PHONE_NO,
PERADDR.STATE,
TBLLOC.LOCATION_CODE,
EMPCOMP.EMPNO,
TBLPOS.POSITION_TITLE,
EMPQUAL.REG_NUMB
FROM
PERSON,
PERADDR,
PERPHONE,
TBLLOC,
TBLPOS,
EMPCOMP,
EMPQUAL
WHERE
person.person_id = tblpos.person_id
AND person.person_id = perphone.person_id
AND person.person_id = peraddr.person_id
AND person.person_id = empqual.person_id
AND person.person_id = empcomp.person_id
AND tblpos.location_code = tblloc.location_code)
Thank you
Maybe you are looking for
-
Loading XML File into Oracle 10G XE
I am trying to load an XML file into 10G XE from the Utilities interface, I have created a Table to load into but when I try to load I get the following cryptic error "XML Load Error". There is no other information, can someone give me some insight w
-
Why is the Artboard background color white in June 2014 release?
After opening Illustrator after the upgrade of the CC suite, the Artboard background is white like the artboard itself. So I can only see the borders of the Artboard when I am in Artboard edit mode. Is this a new feature? How can I reset the Artboard
-
Can't sync between moble me calendar and outlook calendar
I downloaded the newest version of iTunes, checked my preferences. i hit "sync" and it seems to go ok, no error message, but nothing is in my outlook calendar. any advice??
-
Hi There, I have a setup of 9 1522 APs. RAPs=3 and MAPS=6 WLC=4404 Qty 1 (v5.2). All the MAPS have only one hop to nearest RAP. The problem is with one of the MAPs. The MAP shows good signal strength but the client traffic (even ping to controller ma
-
Wireless Signal Flashing On/Off
Hi, the wireless signal on my MacBook keeps "blinking" on and off and I am unable to connect to the wireless provider i normally use. What could be causing this? It is strange because my other computer is connected fine. This has happened before and