Problems while facing Materialized Views
Hello All,
I am facing some problems while creating Materialized Views.
Senario.
SCOTT USER:
sql> Grant select on emp to Public;
sql> Create materialized view log on emp;
Connected to LDB User
sql> CREATE MATERIALIZED VIEW mt_emp
Refresh fast
as select * FROM scott.emp;
I am getting error.. Stating that Table doesnt Exist.
Please tell me the Reason..
Note:
If there is No Log on table Emp then it is throwing the error that there in no LOG on the EMP Table.
Now when I create a Log on EMP table --> Then it is giving the Problem that Table doesn't Exist.
Hello paragjp
The Below are the Steps I am Implementing..
Connect as Scott User.
SQL> Grant select on Emp to Public;
SQL> Create materialized view log on emp with primar key;
Now I will be Connecting to Other User Say LDB
Connect as LDB User
SQL> CREATE MATERIALIZED VIEW mt_emp
Refresh fast
as select * FROM scott.emp;
-- The Below Errors are comming
ERROR at line 3:
ORA-12018: following error encountered during code generation for "K5ESK_LDB2"."MT_EMP"
ORA-00942: table or view does not exist
Similar Messages
-
Error While Creating Materialized View
Hello,
I am getting error ORA-22818: subquery expressions not allowed here while creating materialized view. I am using Oracle9i Enterprise Edition Release 9.2.0.1.0. Below pasted is my SQL Script.
Any help is highly appreciable.
Thanks
*********SQL************
select distinct(id),NAME,(select count(GRADE) from employees where
nationality like '%US%'and id=a.organization_id and grade=a.grade
group by ID,GRADE) US,(select count(GRADE) from employees where
nationality not like '%US%' and organization_id=a.organization_id and grade=a.grade
group by ORGANIZATION_ID,GRADE) NON_US,grade from employees a
where grade is not null
group by GRADE,ID,name
order by to_number(grade) descHi,
This is a documented restriction on MVs. You cannot have a scalar express (i.e a select statement) in the select list.
You can get round this by joining your select count(grade).. expression in as an inline view in your FROM clause. Or you can create a normal view without the scalar expression, create your MV as a select from this view, then re-define your view to contain the query you want.
Hope that helps,
Rod West -
Error while creating Materialized View step 3 of 6 using wizard
have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
Statement:----------------
/*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
Stack Trace:----------------
ORA-00942: table or view does not exist.
ORA-02063: preceding line from masterdbname.
All parameters for replication are correct.
Please help me early.
ThanksHello,
In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
Regards, -
Error while creating Materialized View step 3 of 6
I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
Statement:----------------
/*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
Stack Trace:----------------
ORA-00942: table or view does not exist.
ORA-02063: preceding line from masterdbname.
All parameters for replication are correct.
Please help me early.
ThanksHello,
In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
Regards, -
Facing problems while creating tree view
Hi gurus,
I am facing problems while crating the tree view can please explain me what are the basic requirements for creating tree view and explain me which are the methods i need to redefine.
any answer is appreciated.
Regards,
Chetan AgaliHi Chetan,
Maybe Poonam Assudani weblog may help you a little more. Check it's location here:
/people/poonam.assudani/blog/2009/06/24/create-a-tree-view-display-in-crm-web-ui
Kind regards,
Garcia -
Problem with queries while refreshing materialized views
We are in oracle 8.1.7. We have some materialized views that are refreshed with DMBS_REFRESH.REFRESH in a Job. The problem is that when the refresh occurs while a query is executing we get a "Invalid Rowid" or "0RA-08103 Object not longer exists" in the session executing the query.
We already have reproduced the problem. Is this a bug ? Any idea?
Thanks.Check if the objects referred in the MV defination has undergone any reorg recently.
-
Problem in Refresh Materialized Views
Hi
we are facing a problem in deleting data.
delete process got stuck at refresh materialized view. Can anyone tells me what are possible causes?
Regards,
RJ.> we are using PL/SQL Developer
Good choice :)
I have the following custom tabs (among others) set up in the Sessions screen:
Current Wait:
SELECT wait_time
, seconds_in_wait
, state
, event
FROM v$session_wait
WHERE sid = :sid
ORDER BY seq#Session waits:
SELECT sid
, event
, total_waits
, total_timeouts
, ROUND(time_waited/*_micro*/ /100) as seconds
, ROUND(average_wait,1) AS average_wait
, max_wait
, time_waited/*_micro*/
, ROUND(100 * RATIO_TO_REPORT(time_waited) OVER ()) AS percent
FROM v$session_event
WHERE sid = :sid
ORDER BY time_waited_micro DESCCurrent Plan in 9i requires a view such as Tom Kyte's DYNAMIC_PLAN_TABLE (view owner needs SELECT permission on SYS.V_$SQL_PLAN).
Then the "Current Plan" tab is:
SELECT /*+ RULE */ plan_table_output
FROM TABLE(dbms_xplan.display
( 'DYNAMIC_PLAN_TABLE'
, ( SELECT DISTINCT rawtohex(sql_address) || '_0' x
FROM v$session
WHERE sid = :sid
AND serial# = :serial# )
, 'serial') ) -
TP CONFIGURATION PROBLEM ( While creating a View Controller in Component )
Hi All,
I have a problem in TP Config while creating a View Controller in a component i am getting this Exception
Parameter lsm(&1) not in version 0004(&2) of tp configuration .
This Exception Raised from this Function Module : RS_ACCESS_PERMISSION
Any on can please help me to come out of this issue.
Regards And Thank you,
Nirmala.KSounds like you should be using one of the Apps forums, perhaps {forum:id=210}
-
Problems in creating Materialized View from 10g R2 to 11g
Hi,
We have two databases in 10g Release 2. These databases are on two different servers and we use
Materialized views to replicate data between these servers. We are currently using 64 bit version of
oracle 10g release 2 for LINUX.
Oracle Database 10g Release 10.2.0.1.0 - 64 bit Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
We use CENTOS 5 - 64 bit edition
We upgraded one of the databases to 11g (We exported the data from old database and
imported it in new database) . Then we tried to create a Materialized view with incremental refresh
on it where the base table is in the second Oracle 10g database.
The problem is that it is not letting us create the view with FAST Refresh. It kept on giving ORA-12028
error. We tried different remedies suggested on forums like creating a view with ROWID, but still it
continued giving us the same error. We also synchronized the characterset of Oracle 10g and Oracle 11g
installations but still it did not work.
Our base table size is pretty large (over 10 Million records) and if we do a full refresh, it takes hours to
refresh it.
Without incremental refresh, we will not be able to fucntion, and to upgrade both database simultaneously
we will need a large down-time which also we can not afford.
Please advise what should we do.
Best Regards
Madhup
Edited by: Madhup on Mar 2, 2009 10:45 AMHello,
Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
I have 6 databases:
2 - 11g
2 - 10g
2 - 9i
Every database of each release has different characterset(UTF8 and AL16UTF16).
I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
Materialized view, which points to 9i database, was successfully created.
Materialized view, which points to 10g database, gets ORA-12028
Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
Did you find the actual reason why this issue does not work??
Thanks,
Alex -
A problem with a Materialized View
Hi,
I have a ordinary table with a three column compound primary key (COL_Id, COL_ValidFrom, COL_CaseId)
I also have a MV that selects from that table. This one compiles just fine. It looks like this:
CREATE MATERIALIZED VIEW "MV_02"
REFRESH FORCE ON COMMIT
AS SELECT COL_Id, COL_ValidFrom, MAX(COL_CaseId) CaseId FROM TBL_MediaText GROUP BY COL_Id, COL_ValidFrom;
Works fine. Now I'm trying to create a second MV that selects from the first MV. It looks like this:
CREATE MATERIALIZED VIEW "MV_03"
REFRESH FORCE ON COMMIT
AS
SELECT a.COL_Id, a.CaseId, a.COL_ValidFrom, NVL(MIN(b.COL_ValidFrom)-1, TO_DATE('2099-12-31','yyyy-mm-dd')) ValidTo
FROM MV_02 a, MV_02 b
WHERE a.COL_Id=b.COL_Id(+) AND a.COL_ValidFrom < b.COL_ValidFrom(+)
GROUP BY a.COL_Id, a.CaseId, a.COL_ValidFrom;
This one does not parse. (ORA-12054) There seem to be a probelem with the ON COMMIT command. I have searched the web and found some info on the subject. It tells me to create a MV log, wich I have. I've also tried to put count(*) and count(b.COL_validfrom). But it just wont work.
I see a possibilty of yhe problem laying in te fact that I join using two parts of my PK. Also there might be a problem with the fact that i can't create a log for MV_02 WITH PRIMARY KEY. Or maybe you can't have a MV selecting from another MV?
Do anyone know how i should specify my Logs and/or querys in order for this to parse?
I'm using 10.1, and I do have the ON REFRESH COMMIT-privilege.
Thanks!
Message was edited by:
DavidNilsMay be you are trying for this....I don't know how helpful is my solution for you.
SQL> CREATE MATERIALIZED VIEW MVE
2 TABLESPACE JAM
3 REFRESH FORCE ON COMMIT
4 AS SELECT D.DEPTNO,D.DNAME, E.ENAME, E.JOB FROM
5 EMP E, DEPT D
6 WHERE D.DEPTNO = E.DEPTNO(+)
7 /
Materialized view created.
SQL> CREATE MATERIALIZED VIEW MVEF
2 TABLESPACE JAM
3 REFRESH FORCE WITH ROWID
4 AS SELECT * FROM MVE;
Materialized view created.Message was edited by:
Jameel -
Error: ORA-00905:Missing keyword while creating Materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.I provided the answer over at the duplicate post ...
ORA-00905: missing keyword error while creating a materialised view
Please, please, please ... please do not duplicate posts. Pick one. If you don't get an answer in a reasonable time - close it (edit the title) and THEN open in a different forum. -
Error while creating materialized view which using database link
Helo!
I'm getting error "ORA-00942: table or view does not exist" when I want to create materialized view.
Details:
1. On destination database I create a database link:
CREATE DATABASE LINK SDATABASE
CONNECT TO MYUSER
IDENTIFIED BY MYUSERPASS
USING 'ORCL';
=> Command "SELECT * FROM TABLE1@SDATABASE" returns data normally!
2. On source database I create MATERIALIZED VIEW LOG:
CREATE MATERIALIZED VIEW LOG
ON TABLE1
WITH PRIMARY KEY
INCLUDING NEW VALUES;
3. Now, when I want to create MATERIALIZED VIEW on destination database:
CREATE MATERIALIZED VIEW TABLE1
REFRESH FAST
START WITH SYSDATE
NEXT SYSDATE + 1/1440
WITH PRIMARY KEY
AS SELECT * FROM TABLE1@SDATABASE;
...I get error "ORA-00942: table or view does not exist"!
How is that possible if command "SELECT * FROM TABLE1@SDATABASE" returns data normally?
Thanks,
VorancAnd, I'm using Oracle 10g.
Voranc -
Error occured while creating MATERIALIZED VIEW
I created as below:
CREATE MATERIALIZED VIEW LOG ON FIN.F_CV_HDR
WITH ROWID, SEQUENCE, PRIMARY KEY;
CREATE MATERIALIZED VIEW LOG ON FIN.F_CV_DTL
WITH ROWID, SEQUENCE;
REATE MATERIALIZED VIEW F_GL_SMRY_MVW
PARALLEL
BUILD IMMEDIATE
REFRESH FAST ON COMMIT AS
SELECT * FROM
SELECT
F_CV_HDR.ROWID "HDR_ID",
CAST(NULL AS ROWID) "DTL_ID",
cah_dsm_trm_tr_code gsv_dsm_trm_tr_code,
cah_dsm_dcmnt_type gsv_dsm_dcmnt_type,
cah_cv_nmbr gsv_dcmnt_nmbr,
cah_lcm_lctn_code dsv_lcm_lctn_code,
cah_dsm_dcmnt_srs gsv_dsm_dcmnt_srs,
cah_cv_date gsv_dcmnt_date,
'G' gsv_sub_code_type,
DECODE(cah_dsm_dcmnt_type,'CPV',0,'CRV',cah_net_amnt) gsv_amnt_dbtd,
DECODE(cah_dsm_dcmnt_type,'CPV','C','CRV','D') gsv_dr_cr_indctr,
cah_net_amnt gsv_amnt,
DECODE(cah_dsm_dcmnt_type,'CPV',cah_net_amnt,'CRV',0) gsv_amnt_crdtd,
cah_asm_sbldgr_code gsv_sub_code,
CAH_RMRKS GSV_RMRKS,
CAST(NULL AS VARCHAR2(3)) GSV_CRS_RFRNCE_TYPE,
CAST(NULL AS VARCHAR2(3)) GSV_CRS_RFRNCE_TR_CODE,
CAST(NULL AS NUMBER(10)) GSV_CRS_RFRNCE_NMBR,
CAST(NULL AS VARCHAR2(6)) GSV_FCM_CRNCY_CODE,
CAST(NULL AS NUMBER(6,3)) GSV_EXCHNGE_RATE,
CAST(NULL AS NUMBER(13,2)) GSV_FRGN_CRNCY_AMNT,
CAST(NULL AS DATE) GSV_DATE_FROM,
CAST(NULL AS DATE) GSV_DATE_TO,
CAST(NULL AS NUMBER(7)) GSV_RJH_NMBR,
CAST(NULL AS VARCHAR2(3)) GSV_PJC_SRS,
CAST(NULL AS NUMBER(7)) GSV_PJC_NMBR,
CAST(NULL AS NUMBER(3)) GSV_PJC_EQPTMNT_SRL,
CAST(NULL AS VARCHAR2(5))GSV_PJC_EXPNSE_HEAD_CODE,
CAST(NULL AS VARCHAR2(3)) gsv_dpm_dprtmnt_code,
cah_asm_amm_main_code gsv_amm_main_code,
CAH_LCM_LCTN_CODE_BOOK GSV_LCM_LCTN_CODE_BOOK,
CAST(NULL AS NUMBER) gsv_dr_cr_advce_srl,
0 gsv_dcmnt_srl_nmbr,
cah_trnsctn_with_indctr gsv_trnsctn_with_indctr,
cah_trnsctnr_code gsv_trnsctnr_code,
0 gsv_net_tds_amnt,
to_number(TO_CHAR(cah_cv_date ,'YYYY')) gsv_year,
to_number(TO_CHAR(cah_cv_date ,'MM')) gsv_mnth,
cah_cv_tmpry_nmbr gsv_tmpry_nmbr,
CAH_SRCE_INDCTR GSV_SRCE_INDCTR,
CAST(NULL AS VARCHAR2(50)) GSV_BILL_NMBR,
CAST(NULL AS DATE) gsv_bill_date,
cah_pay_rcve_name gsv_pay_rcve_name
FROM f_cv_hdr
WHERE CAH_FNCL_CLSRE_INDCTR = 'N'
AND cah_avlble_indctr = 'Y'
UNION ALL
SELECT
F_CV_HDR.ROWID "HDR_ID",
f_cv_dtl.ROWID "DTL_ID",
cah_dsm_trm_tr_code gsv_dsm_trm_tr_code,
cah_dsm_dcmnt_type gsv_dsm_dcmnt_type,
cah_cv_nmbr gsv_dcmnt_nmbr,
cah_lcm_lctn_code dsv_lcm_lctn_code,
cah_dsm_dcmnt_srs gsv_dsm_dcmnt_srs,
cah_cv_date gsv_dcmnt_date,
cad_sub_code_type gsv_sub_code_type,
DECODE(cad_dr_cr_indctr, 'C',0,'D',cad_amnt) gsv_amnt_dbtd,
cad_dr_cr_indctr gsv_dr_cr_indctr,
cad_amnt gsv_amnt,
DECODE(cad_dr_cr_indctr, 'D',0,'C',cad_amnt) gsv_amnt_crdtd,
cad_sub_code gsv_sub_code,
cad_rmrks gsv_rmrks,
cad_crs_rfrnce_type gsv_crs_rfrnce_type,
cad_crs_rfrnce_tr_code gsv_crs_rfrnce_tr_code,
CAD_CRS_RFRNCE_NMBR GSV_CRS_RFRNCE_NMBR,
CAST(NULL AS VARCHAR2(6)) GSV_FCM_CRNCY_CODE,
CAST(NULL AS NUMBER(6,3)) GSV_EXCHNGE_RATE,
CAST(NULL AS NUMBER(13,2)) gsv_frgn_crncy_amnt,
cad_date_from gsv_date_from,
cad_date_to gsv_date_to,
cad_rjh_nmbr gsv_rjh_nmbr,
cad_pjc_srs gsv_pjc_srs,
cad_pjc_nmbr gsv_pjc_nmbr,
cad_pjc_eqpmnt_srl gsv_pjc_eqptmnt_srl,
cad_pjc_expnse_head_code gsv_pjc_expnse_head_code,
cad_dpm_dprtmnt_code gsv_dpm_dprtmnt_code,
cad_amm_main_code gsv_amm_main_code,
cah_lcm_lctn_code_book gsv_lcm_lctn_code_book,
cad_dr_cr_advce_srl gsv_dr_cr_advce_srl,
cad_cv_srl_nmbr gsv_dcmnt_srl_nmbr,
cah_trnsctn_with_indctr gsv_trnsctn_with_indctr,
cah_trnsctnr_code gsv_trnsctnr_code,
0 gsv_net_tds_amnt,
to_number(TO_CHAR(cah_cv_date ,'YYYY')) gsv_year,
to_number(TO_CHAR(cah_cv_date ,'MM')) gsv_mnth,
cah_cv_tmpry_nmbr gsv_tmpry_nmbr,
cah_srce_indctr gsv_srce_indctr,
CAST(NULL AS VARCHAR2(50)) GSV_BILL_NMBR,
CAST(NULL AS DATE) GSV_BILL_DATE,
cah_pay_rcve_name gsv_pay_rcve_name
FROM f_cv_hdr,
F_CV_DTL
WHERE CAH_FNCL_CLSRE_INDCTR = 'N'
AND cah_avlble_indctr = 'Y'
AND cah_lcm_lctn_code = cad_cah_lcm_lctn_code
AND CAH_DSM_DCMNT_TYPE = CAD_CAH_DSM_DCMNT_TYPE
AND cah_cv_tmpry_nmbr = cad_cah_cv_tmpry_nmbr);
Giving below error:
==================================================
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
*Cause: The materialized view did not satisfy conditions for refresh at
commit time.
*Action: Specify only valid options.
==================================================*Action: Specify only valid options.
-
Error while creating Materialized View in AWM
Hello,
I am using Oracle 11g with Analytic WorkSpace Manager 11.1.0.6.0A
I am trying to create materialized view on my Cube..
The Cube has 5 Dimensions out of which Four are having two levels i.e.,
TotalA-->DimensionA
TotalB-->DimensionB...and so on
And one time Dimension having 4 levels
TotalTime-->YEAR-->QUARTER-->MONTH
When i try to create the materialized view, i get an error saying that
"Your metadata changes have been saved, with the following errors
CREATE MATERIALIZED VIEW "ENT.CB$TIME_TIME_HIER"
ORA-02267:column type incompatible with referenced column type"
When i googled regarding this error, it says to change the datatype of the column..
But which column's data type is to be changed..Please throw some light regarding this...
Awaiting for reply..My query is as follows:
SELECT
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_Type1Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Type2Txn_Amount,
sum(cd.SALESAMT *(case when (k.LONG_DESCRIPTION='product1'AND l.level_name='ALL_MODE'AND m.LONG_DESCRIPTION = 'Type1' )then 1 else 0 end)) as Cumm_product1_Type1Txn_Amount,
sum(cd.SALESAMT *(case when (k.LONG_DESCRIPTION='product1'AND l.level_name='ALL_MODE'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_product1_Type2Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode1'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_Mode1_Type1Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode1'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode1_Type2Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode2'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_CLRING_Type1Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode2'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode2_Type2Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode3'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_TRSFER_Type1Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode3'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode3_Type2Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.long_description='Mode3' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Mode3_Txn_Amount,
sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.long_description='Mode2' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Mode2_Txn_Amount,
sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.level_name='ALL_MODE' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_product1_Txn_Amount,
sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_product1Mode1Type1_Txn_Amount,
sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_product1_Mode1_Type2_Txn_Amount,
sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_product1_Mode1_Total_Txn_Amount
/* From dimension views and cube view */
FROM CUSTOMER_ID_CUSTOMER_ID_HIE_VIEW b,
TIME_TIME_HIER_VIEW j,
product_product_HIER_VIEW k,
MODE_MODE_HIER_VIEW l,
TYPE_TYPE_HIER_VIEW m,
CUBETEST_VIEW cd
/* Create level filters */
WHERE b.level_name = 'CUSTOMER_ID'
AND b.LONG_DESCRIPTION='xyz'
AND j.LEVEL_NAME='MONTH'
AND j.END_DATE between to_date('2007-10-31','YYYY-MM-DD') and to_date('2007-10-31','YYYY-MM-DD')
/* Join dimension views to cube view */
AND b.DIM_KEY=cd.ACCOUNT_ID
AND j.DIM_KEY=cd.TIME
AND k.DIM_KEY=cd.product
AND l.DIM_KEY=cd.MODE
AND m.DIM_KEY=cd.TYPE
ORDER BY j.end_date,
k.level_name,
l.level_name,
m.level_name; -
Problem in using Materialized View in VO
Hi i am trying to use Materialized View in my Vo, Sql+ i am able to run the View but i am not able to use the same view in View Object i am getting Invalid Table Name on Testing View Object.
Thanks
BabuDid you verify the above suggestion?
--Shiv
Maybe you are looking for
-
i bought my iphone 4 through ebay and its unlocked. the problem is that my phone does not sync straight away. I sync my music file through autofill. I want to sync ringtones but its not working. I saw cidya aap so i m not sure if it was jailbroken or
-
Ask for a sql sentence(procedure) for copy data to themselves' table
two tables order and orderitem,there are relationship table; order's id is PK orderitem's id is PK,and parentId is FK. and all id are created by sequences:order_id_seq and orderitem_id_seq. order id name 1 aaa 2 bbb orderitem id parentId num 1 1 100
-
Preparing photos for PDF Web Documents
Hi, I am a newcomer to InDesign but use Photoshop. If I put together an InDesign (CS3) document for a company website,and this document is to be viewed online or be available for download, should I prepare the images at 300 dpi / ppi or 72? I am conc
-
What may cause Errors.log to be generated from Essentials configuration wizard?
I customized install.wim to handle specific drivers, and while the OS installs properly... during the Essentials Configuration Wizard, the process nearly immediately stops at 0% and generates this file "Errors.log" with the contents: FATAL: SetFolder
-
TS1741 Remote option doesn't show up
My iTunes library shows up but not the actual remote control option