Create Force View

Hi all,
When I import the dumpfile I get the follwing errors...
IMP-00041: Warning: object created with compilation warnings
"CREATE FORCE VIEW "uni"."V_F_OFS_REQUEST_DETAIL" "
" ("RECID","XMLRECORD","APPLICATION","NAPPLICATION","VERSION","NVERSION","F"
"UNCTION","NFUNCTION","TRANS_REFERENCE","NTRANS_REFERENCE","USER_NAME","NUSE"
"R_NAME","COMPANY","NCOMPANY","DATE_TIME_RECD","NDATE_TIME_RECD","DATE_TIME_"
"QUEUE","NDATE_TIME_QUEUE","DATE_TIME_PROC","NDATE_TIME_PROC","STATUS","NSTA"
"TUS","MSG_IN","NMSG_IN","MSG_OUT","NMSG_OUT","ACTION","NACTION","GTS_CONTRO"
"L","NGTS_CONTROL","NO_OF_AUTH","NNO_OF_AUTH") AS "
"SELECT x.RECID, x.XMLRECORD.getClobVal() "XMLRECORD""
",NVL(extractValue(x.xmlrecord,'/row/c1'),'^A') "APPLICATION",NVL(NUMCAST(ex"
"tractValue(x.xmlrecord,'/row/c1')),0) "nAPPLICATION",NVL(extractValue(x.xml"
"record,'/row/c2'),'^A') "VERSION",NVL(NUMCAST(extractValue(x.xmlrecord,'/ro"
"w/c2')),0) "nVERSION",NVL(extractValue(x.xmlrecord,'/row/c3'),'^A') "FUNCTI"
"ON",NVL(NUMCAST(extractValue(x.xmlrecord,'/row/c3')),0) "nFUNCTION",NVL(ext"
"ractValue(x.xmlrecord,'/row/c4'),'^A') "TRANS_REFERENCE",NVL(NUMCAST(extrac"
"tValue(x.xmlrecord,'/row/c4')),0) "nTRANS_REFERENCE",NVL(extractValue(x.xml"
"record,'/row/c5'),'^A') "USER_NAME",NVL(NUMCAST(extractValue(x.xmlrecord,'/"
"row/c5')),0) "nUSER_NAME",NVL(extractValue(x.xmlrecord,'/row/c6'),'^A') "CO"
"MPANY",NVL(NUMCAST(extractValue(x.xmlrecord,'/row/c6')),0) "nCOMPANY",NVL(e"
How to overcome this? and how to avoid this? Pls suggest me
Thanks in advance..

Yes, force view command never gives an error, its always a warning. And if you are getting this error during import, dont worry, view have been created in your schema by import command. This might happen when view is refers to any table that actually is not present. In your case it might be a case when view in the current schema refers table in another schema. So i think you should just try to query that view in the schema where you have just done the import.
Also to verify that why error came, you can go to the source schema and check for the base table of the view under consideration. From there you can get useful information about the actual base table and why import showing up the warning.

Similar Messages

  • Is it possible to create materialized view log file for force refresh

    Is it possible to create materialized view log file for force refresh with join condition.
    Say for example:
    CREATE MATERIALIZED VIEW VU1
    REFRESH FORCE
    ON DEMAND
    AS
    SELECT e.employee_id, d.department_id from emp e and departments d
    where e.department_id = d.department_id;
    how can we create log file using 2 tables?
    Also am copying M.View result to new table. Is it possible to have the same values into the new table once the m.view get refreshed?

    You cannot create a record as a materialized view within the Application Designer.
    But there is workaround.
    Create the record as a table within the Application Designer. Don't build it.
    Inside your database, create the materialized with same name and columns as the record created previously.
    After that, you'll be able to work on that record as for all other within the Peoplesoft tools.
    But keep in mind do never build that object, that'll drop your materialized view and create a table instead.
    Same problem exists for partitioned tables, for function based-indexes and some other objects database vendor dependant. Same workaround is used.
    Nicolas.

  • Create or replace force view

    Back again - cleanup did not fix. Why am I getting 'missing keyword' error?
    Thanks for your eyes!
    Alexandra
    code
    CREATE OR REPLACE FORCE VIEW "DISC_AUTH_ECR_VW" ("DISC_AUTH_ID", "DISC_DT", "REQUESTOR", "BRANDING", "REASON", "WU_COST_DT", "DC_RECEIVED_DT", "RUNOUT_TYPE", "STOCK_DISPO", "INV_ADJ_CODE", "INVOICE_CUSTO", "INVOICE_CMNT", "CUST_BILLTO", "BILL_TO_STATUS", "CUST_NAME", "CUST_PHONE", "CUST_EMAIL", "FINAL_DISPO_DT", "CNTRLR_DT", "CNTRLR_SIG", "SM_DT", "SM_SIG", "RELEASE_TO_ECR", "REJECT_RSN", "SHELF_LIFE", "QTY_OH", "ITEM_COST", "FINAL_CUST_COST", "GRAND_TOT_CMPNTS_FG", "GRAND_TOT_FINAL_CUSTO", "ITEM_LVL_RI", "ITEM_LVL_PKG", "ITEM_LVL_BL", "ITEM_LVL_SUB_ASSY", "ITEM_LVL_FG", "RO_TYPE_SUMMARY", "DISCNO", "PL_NAME", "DTRMN_WO_DESCR", "CUST_OTHER_STREET", "CUST_OTHER_CITY", "CUST_OTHER_STATE", "CUST_OTHER_ZIP", "CURRENT_DISCNO", "ECR_FORM_ID", "ECRNO")
    select
    cast("DOC_DISC_AUTHORIZATION"."DISC_AUTH_ID" as number(6,0)) AS "DISC_AUTH_ID",
    cast("DOC_DISC_AUTHORIZATION"."DISC_DT" as varchar2(15)) AS "DISC_DT",
    cast("DOC_DISC_AUTHORIZATION"."REQUESTOR" as varchar2(30)) AS "REQUESTOR",
    cast("DOC_DISC_AUTHORIZATION"."BRANDING" as varchar2(30)) AS "BRANDING",
    cast("DOC_DISC_AUTHORIZATION"."REASON" as varchar2(1000)) AS "REASON",
    cast("DOC_DISC_AUTHORIZATION"."WU_COST_DT" as varchar2(15)) AS "WI_COST_DT",
    cast("DOC_DISC_AUTHORIZATION"."DC_RECEIVED_DT" as varchar2(15)) AS "DC_RECEIVED_DT",
    cast("DOC_DISC_AUTHORIZATION"."RUNOUT_TYPE" as varchar2(30) AS "RUNOUT_TYPE",
    cast("DOC_DISC_AUTHORIZATION"."STOCK_DISPO" as varchar2(30)) AS "STOCK_DISPO",
    cast("DOC_DISC_AUTHORIZATION"."INV_ADJ_CODE" as varchar2(30)) AS "INV_ADJ_CODE",
    cast("DOC_DISC_AUTHORIZATION"."INVOICE_CUSTO" as varchar2(30)) AS "INVOICE_CUSTO",
    cast("DOC_DISC_AUTHORIZATION"."INVOICE_CMNT" as varchar2(2000)) AS "INVOICE_CMNT",
    cast("DOC_DISC_AUTHORIZATION"."CUST_BILLTO" as varchar2(30)) AS "CUST_BILLTO",
    cast("DOC_DISC_AUTHORIZATION"."BILL_TO_STATUS" as varchar2(30)) AS "BILL_TO_STATUS",
    cast("DOC_DISC_AUTHORIZATION"."CUST_NAME" as varchar2(100)) AS "CUST_NAME",
    cast("DOC_DISC_AUTHORIZATION"."CUST_PHONE" as varchar2(30)) AS "CUST_PHONE",
    cast("DOC_DISC_AUTHORIZATION"."CUST_EMAIL" as varchar2(100)) AS "CUST_EMAIL",
    cast("DOC_DISC_AUTHORIZATION"."FINAL_DISPO_DT" as varchar2(15)) AS "FINAL_DISPO",
    cast("DOC_DISC_AUTHORIZATION"."CNTRLR_DT" as varchar2(15)) AS "CNTRLR_DT",
    cast("DOC_DISC_AUTHORIZATION"."CNTRLR_SIG" as varchar2(10)) AS "CNTRLR_SIG",
    cast("DOC_DISC_AUTHORIZATION"."SM_DT" as varchar2(15)) AS "SM_DT",
    cast("DOC_DISC_AUTHORIZATION"."SM_SIG" as varchar2(10)) AS "SM_SIG",
    cast("DOC_DISC_AUTHORIZATION"."RELEASE_TO_ECR" as varchar2(30)) AS "RELEASE_TO_ECR",
    cast("DOC_DISC_AUTHORIZATION"."REJECT_RSN" as varchar2(4000)) AS "REJECT_RSN",
    cast("DOC_DISC_AUTHORIZATION"."SHELF_LIFE" as varchar2(30)) AS "SHELF_LIFE",
    cast("DOC_DISC_AUTHORIZATION"."QTY_OH" as number(10,4)) AS "QTY_OH",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_COST" as number(10,4)) AS "ITEM_COST",
    cast("DOC_DISC_AUTHORIZATION"."FINAL_CUST_COST" as number(10,4)) AS "FINAL_CUST_COST",
    cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_CMPNTS_FG" as number(10,4)) AS "GRAND_TOT_CMPNTS_FG",
    cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_FINAL_CUSTO" as number(10,4)) AS "GRAND_TOT_FINAL_CUSTO",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_RI" as varchar2(30)) AS "ITEM_LVL_RI",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_PKG" as varchar2(30)) AS "ITEM_LVL_PKG",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_BL" as varchar2(30)) AS "ITEM_LVL_BL",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_SUB_ASSY" as varchar2(30)) AS "ITEM_LVL_SUB_ASSY",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_FG" as varchar2(30)) AS "ITEM_LVL_FG",
    cast("DOC_DISC_AUTHORIZATION"."RO_TYPE_SUMMARY" as varchar2(1000)) AS "RO_TYPE_SUMMARY",
    cast("DOC_DISC_AUTHORIZATION"."DISCNO" as varchar2(30)) AS "DISCNO",
    cast("DOC_DISC_AUTHORIZATION"."PL_NAME" as varchar2(100)) AS "PL_NAME",
    cast("DOC_DISC_AUTHORIZATION"."DTRMN_WO_DESCR" as varchar2(30)) AS "DTRMN_WO_DESCR",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STREET" as varchar2(100)) AS "CUST_OTHER_STREET",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_CITY" as varchar2(30)) AS "CUST_OTHER_CITY",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STATE" as varchar2(10)) AS "CUST_OTHER_STATE",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_ZIP" as varchar2(15)) AS "CUST_OTHER_ZIP",
    cast("DOC_DISC_AUTHORIZATION"."CURRENT_DISCNO" as varchar2(10)) AS "CURRENT_DISCNO",
    cast("DOC_ECR_FORM"."ECR_FORM_ID" as varchar2(10)) AS "ECR_FORM_ID",
    cast("DOC_ECR_FORM"."ECRNO" as varchar2(10)) AS "ECRNO"
    FROM "DOC_DISC_AUTHORIZATION" "DOC_DISC_AUTHORIZATION", "DOC_ECR_FORM" "DOC_ECR_FORM"
    WHERE "DOC_DISC_AUTHORIZATION"."ECR_FORM_ID" = "DOC_ECR_FORM"."ECR_FORM_ID"
    /code
    Edited by: userRRRYB on Aug 22, 2012 8:51 PM

    Here it is in full working form. It's always good to have a second set of eyes and a great boss.
    code/
    CREATE OR REPLACE FORCE VIEW "DISC_AUTH_ECR_VW" ("DISC_AUTH_ID", "DISC_DT", "REQUESTOR", "BRANDING", "REASON", "WU_COST_DT", "DC_RECEIVED_DT", "RUNOUT_TYPE", "STOCK_DISPO", "INV_ADJ_CODE", "INVOICE_CUSTO", "INVOICE_CMNT", "CUST_BILLTO", "BILL_TO_STATUS", "CUST_NAME", "CUST_PHONE", "CUST_EMAIL", "FINAL_DISPO_DT", "CNTRLR_DT", "CNTRLR_SIG", "SM_DT", "SM_SIG", "RELEASE_TO_ECR", "REJECT_RSN", "SHELF_LIFE", "QTY_OH", "ITEM_COST", "FINAL_CUST_COST", "GRAND_TOT_CMPNTS_FG", "GRAND_TOT_FINAL_CUSTO", "ITEM_LVL_RI", "ITEM_LVL_PKG", "ITEM_LVL_BL", "ITEM_LVL_SUB_ASSY", "ITEM_LVL_FG", "RO_TYPE_SUMMARY", "DISCNO", "PL_NAME", "DTRMN_WO_DESCR", "CUST_OTHER_STREET", "CUST_OTHER_CITY", "CUST_OTHER_STATE", "CUST_OTHER_ZIP", "CURRENT_DISCNO", "ECR_FORM_ID", "ECRNO") AS
    select
    cast("DOC_DISC_AUTHORIZATION"."DISC_AUTH_ID" as number(6,0)) AS "DISC_AUTH_ID",
    cast("DOC_DISC_AUTHORIZATION"."DISC_DT" as varchar2(15)) AS "DISC_DT",
    cast("DOC_DISC_AUTHORIZATION"."REQUESTOR" as varchar2(30)) AS "REQUESTOR",
    cast("DOC_DISC_AUTHORIZATION"."BRANDING" as varchar2(30)) AS "BRANDING",
    cast("DOC_DISC_AUTHORIZATION"."REASON" as varchar2(1000)) AS "REASON",
    cast("DOC_DISC_AUTHORIZATION"."WU_COST_DT" as varchar2(15)) AS "WI_COST_DT",
    cast("DOC_DISC_AUTHORIZATION"."DC_RECEIVED_DT" as varchar2(15)) AS "DC_RECEIVED_DT",
    cast("DOC_DISC_AUTHORIZATION"."RUNOUT_TYPE" as varchar2(30)) AS "RUNOUT_TYPE",
    cast("DOC_DISC_AUTHORIZATION"."STOCK_DISPO" as varchar2(30)) AS "STOCK_DISPO",
    cast("DOC_DISC_AUTHORIZATION"."INV_ADJ_CODE" as varchar2(30)) AS "INV_ADJ_CODE",
    cast("DOC_DISC_AUTHORIZATION"."INVOICE_CUSTO" as varchar2(30)) AS "INVOICE_CUSTO",
    cast("DOC_DISC_AUTHORIZATION"."INVOICE_CMNT" as varchar2(2000)) AS "INVOICE_CMNT",
    cast("DOC_DISC_AUTHORIZATION"."CUST_BILLTO" as varchar2(30)) AS "CUST_BILLTO",
    cast("DOC_DISC_AUTHORIZATION"."BILL_TO_STATUS" as varchar2(30)) AS "BILL_TO_STATUS",
    cast("DOC_DISC_AUTHORIZATION"."CUST_NAME" as varchar2(100)) AS "CUST_NAME",
    cast("DOC_DISC_AUTHORIZATION"."CUST_PHONE" as varchar2(30)) AS "CUST_PHONE",
    cast("DOC_DISC_AUTHORIZATION"."CUST_EMAIL" as varchar2(100)) AS "CUST_EMAIL",
    cast("DOC_DISC_AUTHORIZATION"."FINAL_DISPO_DT" as varchar2(15)) AS "FINAL_DISPO",
    cast("DOC_DISC_AUTHORIZATION"."CNTRLR_DT" as varchar2(15)) AS "CNTRLR_DT",
    cast("DOC_DISC_AUTHORIZATION"."CNTRLR_SIG" as varchar2(10)) AS "CNTRLR_SIG",
    cast("DOC_DISC_AUTHORIZATION"."SM_DT" as varchar2(15)) AS "SM_DT",
    cast("DOC_DISC_AUTHORIZATION"."SM_SIG" as varchar2(10)) AS "SM_SIG",
    cast("DOC_DISC_AUTHORIZATION"."RELEASE_TO_ECR" as varchar2(30)) AS "RELEASE_TO_ECR",
    cast("DOC_DISC_AUTHORIZATION"."REJECT_RSN" as varchar2(4000)) AS "REJECT_RSN",
    cast("DOC_DISC_AUTHORIZATION"."SHELF_LIFE" as varchar2(30)) AS "SHELF_LIFE",
    cast("DOC_DISC_AUTHORIZATION"."QTY_OH" as number(10,4)) AS "QTY_OH",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_COST" as number(10,4)) AS "ITEM_COST",
    cast("DOC_DISC_AUTHORIZATION"."FINAL_CUST_COST" as number(10,4)) AS "FINAL_CUST_COST",
    cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_CMPNTS_FG" as number(10,4)) AS "GRAND_TOT_CMPNTS_FG",
    cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_FINAL_CUSTO" as number(10,4)) AS "GRAND_TOT_FINAL_CUSTO",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_RI" as varchar2(30)) AS "ITEM_LVL_RI",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_PKG" as varchar2(30)) AS "ITEM_LVL_PKG",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_BL" as varchar2(30)) AS "ITEM_LVL_BL",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_SUB_ASSY" as varchar2(30)) AS "ITEM_LVL_SUB_ASSY",
    cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_FG" as varchar2(30)) AS "ITEM_LVL_FG",
    cast("DOC_DISC_AUTHORIZATION"."RO_TYPE_SUMMARY" as varchar2(1000)) AS "RO_TYPE_SUMMARY",
    cast("DOC_DISC_AUTHORIZATION"."DISCNO" as varchar2(30)) AS "DISCNO",
    cast("DOC_DISC_AUTHORIZATION"."PL_NAME" as varchar2(100)) AS "PL_NAME",
    cast("DOC_DISC_AUTHORIZATION"."DTRMN_WO_DESCR" as varchar2(30)) AS "DTRMN_WO_DESCR",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STREET" as varchar2(100)) AS "CUST_OTHER_STREET",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_CITY" as varchar2(30)) AS "CUST_OTHER_CITY",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STATE" as varchar2(10)) AS "CUST_OTHER_STATE",
    cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_ZIP" as varchar2(15)) AS "CUST_OTHER_ZIP",
    cast("DOC_DISC_AUTHORIZATION"."CURRENT_DISCNO" as varchar2(10)) AS "CURRENT_DISCNO",
    cast("DOC_ECR_FORM"."ECR_FORM_ID" as varchar2(10)) AS "ECR_FORM_ID",
    cast("DOC_ECR_FORM"."ECRNO" as varchar2(10)) AS "ECRNO"
    FROM "DOC_DISC_AUTHORIZATION" "DOC_DISC_AUTHORIZATION", "DOC_ECR_FORM" "DOC_ECR_FORM"
    WHERE "DOC_DISC_AUTHORIZATION"."ECR_FORM_ID" = "DOC_ECR_FORM"."ECR_FORM_ID"
    /code

  • Do I need to create a view for this?

    Hi Ihave got 2 tables emp and project
    In emp tabe:
    emp_no
    family name
    given name
    In porgect table:
    emp_no
    status(assigned,unassigned)
    start_date
    end_date
    emp_no Family_name given_name
    1 Smith John
    In project table same employee can have many assigement eg
    emp_no status start_date end_date
    1 assigned 01-may-08 01-july-08
    1 assigned 01-sep-08 01-july-09
    1 unassigned 01-july-09 01-oct-09
    In the form:
    there are 2 querable fields "project ends between field1(date) and field2(date)" which is used to
    retrive records which have end date between field1 and field2.
    The following fields are needed to get from database:
    emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
    Requirements:
    1. project.start_date and project.end_date must be the latest project_end_date for the same emp
    so in the above sample date
    2. No. of time assigned is a count of total of number records which have status='assign'
    So for the given sample data the record expected after query would be(field1=01-jun-08 field2=02-july-09)
    emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
    Smith John 01-sep-08 01-july-09 2
    What is the best approach to get:
    1 The lastest project(latest end_date) for the emp
    2. get No.of time assigned.
    Do I need to create a view for this? If yes, any sample sql code this this?
    Thanks for your help

    Hi W1zard,
    Thanks for your reply. Could you clarify the following points for me:
    1.) you could create a master block basing on your emp table and a detail block basing on your project table with the relation over emp_no. set the default_where clause of your detail block programmatically using
    set_block_property('project', default_where, 'status = ''assigned'' and <your_date_criteria>');
    Q1: where I pit this code? in pre-query trigger in detail block?
    2.) Of course you could create a view to join both of your tables if you don't want to use master detail blocks; Also do the join over emp_no
    create or replace force view v_emp as
    select emp.family_name, emp.given_name, project.start_date, project.end_date
    from emp, project
    where emp.emp_no = project.emp_no
    Q2 As I mentioned before, there are multipal entries for the same emp in project table and we only need the maching record from project table which has latest end_date. So I think I need something like
    max(project.end_date) somewhere in create view to make sure only one record for one employee.
    Also is there possible to include the no. of assigned field(select count(*) from project where status='assigned' and emp=emp_no) into the view as well?
    Q3 All the fields mentioned above are diaplay-only. So Can I create a control block which has all the fields from emp and project. Then populate them with my sql. The question is
    where I put this customerised sql so when user click excute query. My sql will run and display one the form?
    REally appreciated your help!
    Michael

  • How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS

    Hi @ all,
    i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
    It works fine with a simple Request in the MATERIALIZED VIEW:
    CREATE MATERIALIZED VIEW MV_ZOTD43_P
    TABLESPACE GDII
    BUILD IMMEDIATE
    REFRESH FORCE AS
    SELECT * FROM ZOTD43_P;
    COMMIT;
    CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
    TABLESPACE "GDII"
    WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
    call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
    But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
    CREATE MATERIALIZED VIEW MV_TEST
    TABLESPACE GDII
    BUILD IMMEDIATE
    REFRESH FORCE AS
    SELECT lptd04_p.sst_nr AS sst_nr,
    lptd03_p.aaaa AS aaaa,
    lptd04_geom.geom as geom
    FROM lptd04_p lptd04_p
    JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
    JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
    JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
    COMMIT;
    CREATE MATERIALIZED VIEW LOG ON LPTD04_P
    TABLESPACE "GDII"
    WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
    call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
    Error report:
    SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
    ORA-06512: in Zeile 1
    12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
    *Cause:    The materialized view log does not exist or cannot be used. PCT
    refresh is also not enabled on the materialized view
    *Action:   Use just REFRESH, which will reinstantiate the entire table.
    If a materialized view log exists and the form of the materialized
    view allows the use of a materialized view log or PCT refresh is
    possible after a given set of changes, REFRESH FAST will
    be available starting the next time the materialized view is
    refreshed.
    Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
    Regards,
    Greq

    Thanks for the link Alessandro ,
    the error seems something to do with the Column-Type SDO_GEOMETRY, so
    i create a new thread in the Spatial Discussion forum:
    FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
    Regards,
    Greq

  • Error in creating materialized view

    Hi all,
    I am trying to create the following materialized view, but throwing me the error message below
    CREATE MATERIALIZED VIEW "MVIW"."XXFA_R051_SHT2_AMV"
    (PARTITION BY LIST (PERIOD_YEAR)
    PARTITION YEAR2006 VALUES LESS ('2006'),
    PARTITION YEAR2007 VALUES LESS ('2007'),
    PARTITION YEAR2007 VALUES LESS ('2008'))
    TABLESPACE "MVIEW"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH FORCE ON DEMAND
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS (SELECT * FROM XXFA_R051_SHT2_MV);
    SQL Error: ORA-00907: missing right parenthesis
    00907. 00000 - "missing right parenthesis"
    *Cause:   
    *Action:
    Any pointers would be appreciated
    Thanks
    VR

    What is it your are actually trying to do?
    On one hand you say:
    PARTITION BY LIST (PERIOD_YEAR)
    Then you proceed to use the syntax for range partitioning:
    VALUES LESS ('2006'),
    Look up the correct syntax at http://tahiti.oracle.com or the demos in Morgan's Library at www.psoug.org.

  • Error while creating the view from one instance to another instance

    Hi Experts
    I want to Create a view which reside in one instance for example xxx Instance . I want to create the same view which reside in xxx instance to another instance for example YYY Instance How to acheive this ?
    I tried desc the View take the view script from XXX instance and copied the view script to YYY instance when I compiled Iam getting an Error
    For Example My view in XXX Instance
    CREATE OR REPLACE FORCE VIEW xxx.sample
    First_name,
    last_name
    as
         select "F_NAME",
                 "L_NAME"
         FROM  EMP;When try to copy and compile the same view in my YYY Instance
    i am getting error
    ORA: table or view does not exist
    Advance Thanks
    AT

    A.T wrote:
    Hi Experts ,
    Thanks For all your valuable information I amTrying Of DB Link i think so
    As per My understanding If wrong anywhere please advice me
    Here Instance is Like : One DB 10g divided into several Instance like (test , devlopement , production Instance)
    Now hope i ll make my req clear .
    Coming to my reqirement
    the actual table EMP is in xxi.TEST (Here xxi => Schema and test is an Instance )
    I want to create the view which is based on by table EMP which in my test instance to devoplment instance
    For example xxo.development (here xxo => Schema and development is an Instance )
    Need to access the xxi schema in Test Instance How can I create a DB Link please share your ideas and advice me
    Advance Thanks
    ATIt's still not at all clear, but let me outline what I think you are after
    Given a database, ORCL_A
    In database ORCL_A we have a schema, HALFTRACK
    User HALFTRACK has a table, MYSTUFF
    Given a database, ORCL_B
    In database ORCL_B we have a user GREENBRASS
    User GREENBRASS needs to be able to query the table HALFTRACK.MYSTUFF.
    In database ORCL_B, as user GREENBRASS
    create database link mylink
    connect to halftrack identified by halftracks_pswd
    using ORCL_A;
    select * from mytable@mylink;The db link defines a connection specification to ORCL_A, using the credentials of a user on ORCL_A. The target of the USING clause in the link definition must be an entry in the tnsames.ora file on the server hosting database ORCL_B.
    When querying through the link, database ORCL_B is simply acting as a client to ORCL_A, no different that a sqlplus session on ORACL_B's server. As far as ORCL_A is concerned, ORCL_B is just another client requesting a connection, connecting with the credentials defined in the link definition.

  • 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" privilege

    After 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.

  • Create materialized view with specific column sizes

    Hi all,
    I'm trying to create a materialized view with a specific a column size. Something like
    create materialized view test_mv
    refresh force on demand
    as
    select id,
           cast(my_compound_field as nvarchar2(50))
    from ( select id,
                  field1 || field2 my_compound_field
           from   my_table);But Oracle seems to ignore the cast and takes the maximum size it finds for field1 || field2 in the select query. The resulting table has a column nvarchar2(44) instead of nvarchar2(50).
    This can give a problem when the view is refreshed... there could be new data that exceeds the current size, i.e. where length(field1 || field2) > 44.
    How can I override the column size of a field in a materialized view?
    Edit: Some additional info to clarify my case:
    field1 and field2 are defined as nvarchar2(25). field1 || field2 can theoretically have a length of 50, but there is currently no data in my table that results in that length, the max is 44. I am afraid that there will be data in the future that exceeds 44, resulting in an error when the MV is refreshed!
    Edited by: Pleiadian on Jan 25, 2011 2:06 PM

    Cannot reproduce what you are saying is happening.
    SQL> create table t (a nvarchar2(50), b nvarchar2(50));
    Table created.
    SQL> create materialized view tmv as
      2  select a, b, a || b c from t;
    Materialized view created.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(100)
    SQL> drop materialized view tmv;
    Materialized view dropped.
    SQL> create materialized view tmv as
      2  select a, b, substr(a || b, 1, 10) c from t;
    Materialized view created.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(10)
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL>Edited by: 3360 on Jan 25, 2011 8:10 AM
    And with data
    SQL> insert into t values ('3123423423143hhshgvcdcvw', 'ydgeew  gdfwe   dfefde  wfjjjjjjj');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> desc tmv
    Name                                      Null?    Type
    A                                                  NVARCHAR2(50)
    B                                                  NVARCHAR2(50)
    C                                                  NVARCHAR2(10)
    SQL> select * from tmv;
    A
    B                                                  C
    3123423423143hhshgvcdcvw
    ydgeew  gdfwe   dfefde  wfjjjjjjj                      3123423423

  • Error when Create Materialized View

    Hi
    When I tried to create MV show me error :
    SQL> @CRIA_MV_ARC_BW.SQL
    AND INDUSTRIAL.CD_FABRICA = SUBSTR(ARC.DS_ARC, 1, 3)
    ERROR at line 88:
    ORA-01031: insufficient privilegesI am using Oracle 9.02 and there are Grant for all Tablles , my query of creation is:
    CREATE MATERIALIZED VIEW CLIBGF.MV_ARC_BW
    NOCACHE
    LOGGING
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH FORCE
    START WITH TO_DATE('26-nov-2009 02:00:00','dd-mon-yyyy hh24:mi:ss')
    NEXT trunc(sysdate) + 1/12
    ENABLE QUERY REWRITE
    AS
    SELECT     MAX(NVL((SELECT  DECODE(A.T$CDNG$O,'F',DECODE(TRIM(B.T$CALC$O),'S','C',A.T$CDNG$O),A.T$CDNG$O)
                     FROM TRITON.TTDFAT995501 A, TRITON.TTDFAT996501 B
                    WHERE A.T$OCOM$O + 0 = ARC.CD_UNIDADE_EXPEDIDORA
                      AND A.T$NDOC$O = NOTAS.CD_NOTA
                      AND (A.T$OCOM$O = B.T$OCOM$O AND A.T$NREF$O = B.T$NREF$O)
                                        AND ROWNUM =1),
                   0)) NEGOCIO,
           ARC.CD_CLIENTE CD_CLIENTE,
           CLIENTE.T$NAMA DS_CLIENTE,
           ARC.CD_ARC,
           ARC.CD_STATUS,
           ARC.CD_STATUS || ' - ' || STATUS.DS_STATUS STATUS,
           TO_CHAR(ARC.DT_EMISSAO, 'DD/MM/YYYY') DT_EMISSAO,
           TO_CHAR(ACAO_INV.DT_REALIZADO, 'DD/MM/YYYY') DT_REALIZADO_INVESTIGACAO,
           ARC.CD_MARCA || ' - ' || MARCA.T$DSMA$O MARCA,
           ARC.CD_PRODUTO CD_PRODUTO,
           EMBALAGEM.T$CDAC$O || ' - ' || EMBALAGEM.T$DESC$O DS_EMBALAGEM,
           SUBSTR(ARC.DS_ARC, 1, 3) CD_COMPANHIA_PRODUTORA,
            ARC.CD_MOTIVO_RECLAMACAO CD_MOTIVO_RECLAMACAO,
            MOTIVO.DS_ITEM DS_MOTIVO_RECLAMACAO,
           DECODE(ARC.FL_PROCEDENCIA, 0, 'PROCEDENTE', 1, 'IMPROCEDENTE', ' ') PROCEDENCIA,
           SUM(NVL((SELECT SUM(NVL(T$IQUA$O, 0))
                     FROM TRITON.TTDFAT995501 A, TRITON.TTDFAT996501 B
                    WHERE A.T$OCOM$O + 0 = ARC.CD_UNIDADE_EXPEDIDORA
                      AND A.T$NDOC$O = NOTAS.CD_NOTA
                      AND (A.T$OCOM$O = B.T$OCOM$O AND A.T$NREF$O = B.T$NREF$O)),
                   0)) NR_QUANTIDADE_VENDIDA,
               ARC.NR_QUANTIDADE_AFETADA NR_QUANTIDADE_AFETADA,     
           ARC.NR_QUANTIDADE_AFETADA_REAL NR_QUANTIDADE_AFETADA_REAL,
           DS_JUSTIFICATIVA DSJUST
      FROM ARCTB_ARC                 ARC,
           ARCTB_NOTAS               NOTAS,
           ARCTB_TABELA_MOTIVO       MOTIVO,
           ARCTB_ACAO_IMEDIATA       ACAO_INV,
           ARCTB_ACAO_IMEDIATA       ACAO_IME,
           ARCTB_STATUS              STATUS,
           TRITON.TTCCOM010501       CLIENTE,
           TRITON.TTCCOM936501       CIDADE,
           TRITON.TTIITM001810       D,
           TRITON.TTIITM983501       PRODUTO,
           TRITON.TTFGLD010806       CC,
           TRITON.TTCCOM983501       MARCA,
           TRITON.TTCCOM000501       CIA,
           TRITON.TTIITM982501       NAT,
           SEI.SIBTB_MULTIMARCA      MULTIMARCA,
           SEI.SIBTB_DIRETORIA_DEPTO DIRETORIA,
           TRITON.TTCCOM994501       USUARIO,
           ARCTB_GERENCIA_INDUSTRIAL INDUSTRIAL,
           TRITON.TTIITM984501       EMBALAGEM
    WHERE ARC.CD_ARC = NOTAS.CD_ARC(+)
       AND ARC.CD_ARC = ACAO_INV.CD_ARC(+)
       AND ACAO_INV.CD_TIPO_ACAO(+) = 0
       AND ACAO_INV.CD_ACAO_IMEDIATA(+) = 999
       AND ARC.CD_ARC = ACAO_IME.CD_ARC(+)
       AND ACAO_IME.CD_TIPO_ACAO(+) = 1
       AND ACAO_IME.CD_ACAO_IMEDIATA(+) = 999
       AND ARC.CD_CLIENTE = CLIENTE.T$CUNO(+)
       AND CLIENTE.T$ESTA$L = CIDADE.T$ESTA$L(+)
       AND CLIENTE.T$CDMU$L = CIDADE.T$MUNI$L(+)
       AND TRIM(REPLACE(ARC.CD_PRODUTO, '-', '')) =
           TRIM(REPLACE(D.T$ITEM(+), '-', ''))
       AND TRIM(REPLACE(ARC.CD_PRODUTO, '-', '')) =
           TRIM(REPLACE(PRODUTO.T$ITEM$O(+), '-', ''))
       AND PRODUTO.T$PROC$O = NAT.T$PROC$O(+)
       AND EMBALAGEM.T$CDAC$O(+) = PRODUTO.T$CDAC$O
       AND ARC.CD_MOTIVO_RECLAMACAO = MOTIVO.CD_ITEM(+)
       AND ARC.CD_MARCA = MARCA.T$CDMA$O(+)
       AND SUBSTR(ARC.DS_ARC, 1, 3) = CIA.T$NCMP(+)
       AND ARC.CD_STATUS = STATUS.CD_STATUS(+)
       AND TRIM(ARC.CD_CENTRO_CUSTO) = TRIM(CC.T$DIMX(+))
       AND CC.T$DTYP(+) = 2
       AND CC.T$SUBL(+) = 0
       AND ARC.CD_DEPTO_MULTIMARCA = MULTIMARCA.CD_MULTIMARCA(+)
       AND ARC.CD_DEPTO = DIRETORIA.CD_DEPTO(+)
       AND ARC.CD_USUARIO = TRIM(USUARIO.T$CDUS$O(+))
       AND ARC.CD_STATUS IS NOT NULL
       AND ARC.CD_MOTIVO_RECLAMACAO = MOTIVO.CD_ITEM(+)
       AND INDUSTRIAL.CD_FABRICA = SUBSTR(ARC.DS_ARC, 1, 3)
       GROUP BY TO_CHAR(ARC.DT_EMISSAO, 'YYYY'),
              TO_CHAR(ARC.DT_EMISSAO, 'MM'),
              ARC.CD_ARC,
              ARC.DS_ARC,
              ARC.DS_SUPERVISOR,
              ARC.CD_STATUS,
              STATUS.DS_STATUS,
              TO_CHAR(ARC.DT_EMISSAO, 'DD/MM/YYYY'),
              TO_CHAR(ACAO_INV.DT_ORIGINAL, 'DD/MM/YYYY'),
              TO_CHAR(ACAO_INV.DT_REALIZADO, 'DD/MM/YYYY'),
              TO_CHAR(ACAO_IME.DT_ORIGINAL, 'DD/MM/YYYY'),
              TO_CHAR(ACAO_IME.DT_REALIZADO, 'DD/MM/YYYY'),
              TO_CHAR(ARC.DT_PROCEDENCIA, 'DD/MM/YYYY'),
              TO_CHAR(ARC.DT_RECEBIMENTO, 'DD/MM/YYYY'),
              TO_CHAR(NVL(ARC.DT_APROVACAO_INDUSTRIAL,
                          ARC.DT_APROVACAO_COMERCIAL),
                      'DD/MM/YYYY'),
              ARC.CD_CLIENTE,
              CLIENTE.T$NAMA,
              CIDADE.T$DSCA$L,
              ARC.CD_MARCA,
              MARCA.T$DSMA$O,
              ARC.CD_PRODUTO,
              D.T$SEAK,
              EMBALAGEM.T$CDAC$O || ' - ' || EMBALAGEM.T$DESC$O,
              NAT.T$DESC$O,
              ARC.NR_LOTE,
              ARC.DT_FABRICACAO,
              SUBSTR(ARC.DS_ARC, 1, 3),
              CIA.T$CITY,
              ARC.CD_MOTIVO_RECLAMACAO,
              MOTIVO.DS_ITEM,
              DECODE(ARC.FL_PROCEDENCIA,
                     0,
                     'PROCEDENTE',
                     1,
                     'IMPROCEDENTE',
              ARC.DS_DISPOSICAO,
              ARC.CD_CENTRO_CUSTO,
              CC.T$DESC,
              ARC.NR_QUANTIDADE_AFETADA,
              DS_JUSTIFICATIVA,
              DS_DISPOSICAO,
              CD_RESPONSAVEL_CAUSA,
              ARC.NR_QUANTIDADE_AFETADA_REAL,
              ARC.DT_ATENDIMENTO,
              MOTIVO.CLASSIFICACAO,
              ARC.DS_COORDENADOR,
              ARC.FL_ATENDIMENTO,
              TO_CHAR(ARC.DT_ATENDIMENTO, 'DD/MM/YYYY'),
              ARC.DS_COORDENADOR_INVESTIGACAO,
              INDUSTRIAL.REGIAO
    ORDER BY ARC.CD_ARC DESC;
    Edited by: muttleychess on Nov 25, 2009 10:25 AM

    Please see my privilege
    GRANTEE PRIVILEGE ADM
    CLIBGF CREATE TABLE NO
    CLIBGF CREATE ANY VIEW NO
    CLIBGF CREATE SNAPSHOT NO
    CLIBGF SELECT ANY TABLE NO
    CLIBGF CREATE ANY TRIGGER NO
    CLIBGF CREATE ANY SNAPSHOT NO

  • Reg: Force View

    Kindly let me know in what situation force view created apart from doesn't have base table

    http://tinyurl.com/yhp92vm

  • End of communication channel on creating Materialized view

    Dear All,
    I've Oracle Enterprise Edition(ver 9.0.1.1.1) running on Windows Xp Home Edition, When I run the following statement to create a materialized view I got the famous error ORA-03113: end-of-file on communication channel.And the strange thing is that after this I got disconnected from the database and when I tried to reconnect it showed an Error "Shared memory not available". I was forced to restart my database.
    CREATE MATERIALIZED VIEW CUVF_MVIEW
    TABLESPACE USERS
    NOCACHE
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH COMPLETE
    ON DEMAND
    START WITH
    TO_DATE('08-DEC-2003 11:00:00','dd-mon-yyyy hh24:mi:ss')
    NEXT trunc(sysdate) +13/24
    WITH ROWID
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE AS
    SELECT *
    FROM mySchema.Trasaction_FACT@test_link cuvf
    WHERE
    REFERENCE_DT BETWEEN TRUNC(ADD_MONTHS(SYSDATE,-1),'MON')
    AND LAST_DAY(TRUNC(ADD_MONTHS(SYSDATE,-1),'MON'))

    Like other poster suggested, please post some sample code, query your used to build the view (you can scramble the real table/column name as your wish) and the actual screen capture of the error.
    This will help others to help you. Right now you are only describing symptoms while no one has idea what it really is.

  • How to create materialized  view with parameter and index ?

    Hi all,
    i am using oracle 11g.
    i want to create  parameter materialized view  with two parameter (STORED_VALUE, LOV_NAME) with  an index .
    i have below view
    CREATE OR REPLACE FORCE VIEW SR_MY_TEST(DISPLAYED_VALUE, STORED_VALUE, LOV_NAME) AS
      SELECT  DISPLAYED_VALUE , LOVVALUE.STORED_VALUE , lovname.lov_name
               FROM (SELECT T.LOV_VALUE_ID,
          T.LOV_ID,
          T.ORG_ENTITY_ID,
          T.STORED_VALUE,
          T.DISPLAYED_VALUE,
          T.ENTERPRISE_ID
         FROM MS_QS_LIST_OF_VALUES_T T) lovvalue, ms_qs_lov_names lovname
              WHERE lovvalue.lov_id = lovname.lov_id
                AND lovvalue.org_entity_id = 1
                and LOVVALUE.ENTERPRISE_ID = 100000
                AND LOVNAME.ENTERPRISE_ID = 100000;
    i want to create index on   STORED_VALUE, LOV_NAME
    Thanks
    Damby

    No.AFAIK, there's nothing called as "parameterized MV".
    Materialized View store data like tables (and not like Views). So, does it make sense when you say - "table with parameters" ?
    Could you please explain your business requirement?
    What is the purpose behind those 2 parameters?

  • ORA-00911 error creating a view with PL/SQL

    Hello. Working with SQL Developer, I'm trying to write a procedure that creates a view.
    After a successful compilation, each time I try to execute it I get an ORA-00911 error and I'm not able to find the reason.
    Here's my code. Thanks in advance.
      CREATE OR REPLACE PROCEDURE "DWH_STAR"."STORICO_DATA" (
      DATA_INPUT IN VARCHAR2
    )AS
    BEGIN
      EXECUTE IMMEDIATE '
        CREATE OR REPLACE FORCE VIEW DWH_STAR.V_PORT_STOR_DATA (DATA_DESC, CLIENTE_KEY, PRODOTTO_KEY, AGENTE_KEY, TIPOLOGIA_KEY,
        NUM_ORDINE, NUM_UNITA, RICAVO_LORDO, RICAVO_NETTO, COSTO_STD_TOTALE, GROSS_PROFIT) AS
        SELECT
          dt.DATA_DESC,
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE,
          SUM (NUM_UNITA) NUM_UNITA,
          SUM (RICAVO_LORDO) RICAVO_LORDO,
          SUM (RICAVO_NETTO) RICAVO_NETTO,
          SUM (COSTO_STD_TOTALE) COSTO_STD_TOTALE,
          SUM (GROSS_PROFIT) GROSS_PROFIT
        FROM
          F_VENDUTO fv, D_TEMPO dt
        WHERE
          fv.TEMPO_KEY = dt.TEMPO_KEY
          AND TO_NUMBER(TO_CHAR(dt.DATA_DESC,''YYYYMMDD'')) <=' || DATA_INPUT ||'
        GROUP BY
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE,
          dt.DATA_DESC
        ORDER BY
          dt.DATA_DESC,
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE;
        UNION
        SELECT
          dt.DATA_DESC,
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE,
          - SUM (NUM_UNITA) NUM_UNITA,
          - SUM (RICAVO_LORDO) RICAVO_LORDO,
          - SUM (RICAVO_NETTO) RICAVO_NETTO,
          - SUM (COSTO_STD_TOTALE) COSTO_STD_TOTALE,
          - SUM (GROSSO_PROFIT) GROSS_PROFIT
        FROM
          F_SPEDITO fs, D_TEMPO dt
        WHERE
          (fs.CAUSA_RESO_KEY = 0
           AND fs.TEMPO_KEY = dt.TEMPO_KEY
           AND TO_NUMBER(TO_CHAR(dt.DATA_DESC,''YYYYMMDD'')) <=' || DATA_INPUT ||'
        GROUP BY
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE,
          dt.DATA_DESC
        ORDER BY
          dt.DATA_DESC,
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE
    END;

    remove the order by and semi-colon (;) from the first select. I hope you know that union operator needs the same set of columns to be selected.
    But try avoid creating objects on the fly unless and until it's absolutely necessary and unavoidable.
    Regards
    Raj
    Edited by: R.Subramanian on Jun 21, 2010 7:52 AM
    Edited by: R.Subramanian on Jun 21, 2010 7:53 AM

  • ORA-12052 when create materialized view

    I following the sample in Oracle document to create materialized viewCREATE MATERIALIZED VIEW LOG ON sales
       WITH ROWID, SEQUENCE(amount_sold, time_id, prod_id)   INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW LOG ON times
       WITH ROWID, SEQUENCE (time_id, calendar_year)  INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW LOG ON products
       WITH ROWID, SEQUENCE (prod_id,prod_name)  INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW sales_mv
       BUILD IMMEDIATE   REFRESH FAST ON COMMIT
       AS SELECT t.calendar_year, p.prod_id, p.prod_name,
          SUM(s.amount_sold) AS sum_sales
          FROM times t, products p, sales s
          WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id
          GROUP BY t.calendar_year, p.prod_id, p.prod_name; This works. BUt I actually does not want do aggregation. Thus I changed the MV creation statement toCREATE MATERIALIZED VIEW sales_mv
       BUILD IMMEDIATE REFRESH FAST ON COMMIT
       AS SELECT t.calendar_year, p.prod_id, p.prod_name,s.amount_sold
          FROM times t, products p, sales s
          WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id;I got errorSQL Error: ORA-12052: cannot fast refresh materialized view GLU.SALES_MV
    *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.Please help or point me to the relevant document.
    Thanks

    damorgan, Thank you for you reply.
    the inner table of an outer join did not have UNIQUE constraints on join columns.
    I am not sure how much clearer and explanation can be written.If you look at the query, you will find that there is no outer join in the query.
    sales table does not have unique constraints on prod_id and time_id. If this is the cause of the problem, I cannot change the data but is there a work around. That is way I ask for specific doc. In 11g documents, I only find some info on CREATE MV. That is mainly on syntax but not on requirement.

Maybe you are looking for

  • Essbase Adapter - Intersection validation report

    Is it possible to enable an intersection validation report with the essbase adapter? Otherwise I dont see my errors until the export stage

  • Import podcast MP3 to iphone

    I want to import a podcast into my iphone as an MP3 file in a separate playlist and no longer have considered a podcast.  How can I do that?

  • How to modify this query to get the desired output format

    I hv written a Query to display all the parent table names and their primary key columns(relevant to this foreign key of the child table).The query is given below... SELECT DISTINCT(TABLE_NAME) AS PARENT_TABLE,COLUMN_NAME AS PARENT_COLUMN FROM ALL_CO

  • Datapump Network Import from Oracle 10.2.0 to 10.1.0

    I have self-developed table bulk copy system based on dmbs_datapump API. It is pretty stable and worked very well for a long time on many servers with oracle 10.1.0. But some days ago we have installed new oracle server with oracle 10.2.0 and have no

  • Reporting on device Last Contact time

    Hi all. Got a ZCM 10.1.3 system, and just started working on the Reports feature. Can i run a report of all the devices in the system, and their "Last Contact" time? I tried various date related fields, but none seemed to pull the info i needed. Anyo