How to create a Complex Organization Index  Materialized View Example

Hi
I have a 11g database that I'm trying to create a complex Materialized View that I would like to make Organization Index? How do I specify what I want for a primary Key?
CREATE MATERIALIZED VIEW RCS_STG.MV_NEXT_HOP_iot
ORGANIZATION INDEX
AS
SELECT r2.resource_key, r1.resource_key resource_key2, r2.resource_full_path_name, device_name, device_model,
service_telephone_number, service_package_name, telephone_number.telephone_number_key, c1.created_on
FROM network_resource PARTITION (network_resource_subinterface) r1,
connection c1,
network_resource PARTITION (network_resource_subinterface) r2,
device d1,
tn_network_resource,
telephone_number
WHERE r1.resource_key = c1.resource1_key
AND c1.resource2_key = r2.resource_key
AND d1.device_key = r2.device_key
AND tn_network_resource.resource_key(+) = r2.resource_key
AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
UNION ALL
SELECT r1.resource_key, r2.resource_key resource_key2, r1.resource_full_path_name, device_name, device_model,
service_telephone_number, service_package_name, telephone_number.telephone_number_key, c1.created_on
FROM network_resource PARTITION (network_resource_subinterface) r1,
connection c1,
network_resource PARTITION (network_resource_subinterface) r2,
device d1,
tn_network_resource,
telephone_number
WHERE r1.resource_key = c1.resource1_key
AND c1.resource2_key = r2.resource_key
AND d1.device_key = r1.device_key
AND tn_network_resource.resource_key(+) = r1.resource_key
AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
I get an error message ORA-25175: no PRIMARY KEY constraint found
I would like to specify resource_key, resource_key2, and service_telephone_number as my primary key?

Ah,
I get it now. This is what I did.
CREATE TABLE mv_next_hop_iot
resource_key NUMBER (38),
resource_key2 NUMBER (38),
resource_full_path_name VARCHAR2 (256 BYTE),
device_name VARCHAR2 (64 BYTE),
device_model VARCHAR2 (64 BYTE),
service_telephone_number VARCHAR2 (20 BYTE),
service_package_name VARCHAR2 (64 BYTE),
telephone_number_key NUMBER (38),
created_on DATE,
CONSTRAINT mv_next_hop_pk PRIMARY KEY (resource_key, resource_key2, service_telephone_number)
ORGANIZATION INDEX
CREATE MATERIALIZED VIEW rcs_stg.mv_next_hop_iot
ON PREBUILT TABLE
AS
/* Formatted on 2010/06/10 1:39:04 PM (QP5 v5.149.1003.31008) */
SELECT resource_key, resource_key2, resource_full_path_name, device_name, device_model, service_telephone_number,
service_package_name, telephone_number_key, created_on
FROM (SELECT r2.resource_key, r1.resource_key resource_key2, r2.resource_full_path_name, device_name, device_model,
NVL (service_telephone_number, ' ') AS service_telephone_number, service_package_name,
telephone_number.telephone_number_key, c1.created_on
FROM network_resource PARTITION (network_resource_subinterface) r1,
connection c1,
network_resource PARTITION (network_resource_subinterface) r2,
device d1,
tn_network_resource,
telephone_number
WHERE r1.resource_key = c1.resource1_key
AND c1.resource2_key = r2.resource_key
AND d1.device_key = r2.device_key
AND tn_network_resource.resource_key(+) = r2.resource_key
AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
UNION ALL
SELECT r1.resource_key, r2.resource_key resource_key2, r1.resource_full_path_name, device_name, device_model,
NVL (service_telephone_number, ' ') AS service_telephone_number, service_package_name,
telephone_number.telephone_number_key, c1.created_on
FROM network_resource PARTITION (network_resource_subinterface) r1,
connection c1,
network_resource PARTITION (network_resource_subinterface) r2,
device d1,
tn_network_resource,
telephone_number
WHERE r1.resource_key = c1.resource1_key
AND c1.resource2_key = r2.resource_key
AND d1.device_key = r1.device_key
AND tn_network_resource.resource_key(+) = r1.resource_key
AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key)
Many thanks. the PREBUILT TABLE is the secret.

Similar Messages

  • COPA Report  - How to create a complex formula

    Hi SAP guru,
    Please shed some light on this issue.
    In COPA drill down report, could any of you know how to create a complex formula? My client requires the report to show the conditional formula such as
    IF value field 1 is zero, calculate A
    IF value field 1 is not zero, calculate B etc..
    Your help will greatly be appreciated.

    Hiya,
    Specify the formula for that row, then double-click the value and it provides some options. I believe you can manipulate the calculation based on that.
    The best option would be to create the Value outside of the report and use the report simply to display it.
    Another option would be to use COPA enhancements (using T-Code SMOD) to calculate values. Since you can include ABAP code, you have the freedom to calculate just about anything you want out here.
    Alternatively, you could use Actual Valuation (IMG --> CO --> COPA --> Master Data --> Valuation --> Using Condition Records) and input a formula based on an actual value. If the actual value is something like Sales Revenue, you can "map" it to that field within the Condition Type. Assign the Condition Type to a Value Field and provide a Val Strategy to pick it up during Actual Postings (PV = 1)
    Hope this helps.
    Cheers.

  • E-rec   How to create or generate the index category????? SOS!!!!!

    Hi guys,
    How to create or generate the index category?.
    From the posts of this forum I have read more things but anything works:
    reports:
    -RSRETT02
    -RCF_INITIALIZE_KPRO
    -RSTIRIDX_INDXCAT_RETRIEVE
    Can anyone show me the way?
    Thanks in advance.

    Hello,
    If you haveat least Version 7.10.18 then KPro configurations are no longer required. Did you activate Business Function HCM_ERC_SES_1 as this is required for SES? The scenario to choose will depened on whether you are making a new implementation, upgrading without use of SES before or upgrading after using SES with earlier versions. Scenario 1 is for when you have activated HCM_ERC_CI_3 after using earlier versions with HCM_ERC_SES_1 already activated. Scenario 2 is for those who have upgrade and activated HCM_ERC_CI_3 but where using search without SES in their earlier version. Last scenario is when you are making a new e-Recruiting implementation (not upgrading). Also check notes 1426757 and 817145.
    When you try to search are you getting an error? Can you check in SLG1 transaction after trying to search and post the error messages. Also can you execute report RCF_CHECK_SEARCH_SETTINGS as it will point you to the missing configurations points if any based on your version.
    Regards,

  • How to create configuration of a variant material based on funciton module

    Hello, ABAP experts,
    I want to create configuration of a variant material based on FM ( MRP3 view, set configurable material and configure the variant ).
    I use fuction modules:
        CUXM_SET_CONFIGURATION
        CUCB_CONFIGURATION_TO_DB
    and subsequently commit work.
    But the data table was not updated, that is, MRP3 view is still empty.
    Can you give me a sample, tell me how to used these FMs.
    Thanks and BR.

    When I call FM , CUXM_GET_CONFIGURATION, the SUBRC = 0, but ET_RETURN get two messages: CUXM1-001 , Overwriting existing configuration, and CUXM1-007, Configuration in target system is consistent and complete.
    Can you give me a sample ?

  • How to create a PO for a Material having Net Price but without Info Record?

    Hi,
    When I try to create a PO for a Material having Material Master and Vendor Master maintained but no Info Record, system does not accept the Net Price and the Price Condition also does not appear. Is there any way to create a PO for a Material having Net Price but without Info Record?
    Regards.

    Hi,
    The first time you create a PO for a material/vendor combination, then system will not prompt any price as info record or valid conditions have not been found.
    The next time you create a PO for the same material, then the price will be defaulted/found from the order price history from the info record(As info record would be reated after the first PO is created) and the latest PO price for the mat/ven combination would be found.
    Hope you are clear with this..Any doubts revert back.
    Regards,
    Deepak.

  • How to create reservation for a particular material through Production orde

    Hi gurus
    How to create the reservation manually and through production order?
    Kaisar

    Hi,
    If you convert a Planned Order to production oredr, all the dependent requirements will be converted to Order Reservations.
    If you create a Production Order then the Order Reservations will be created for the BOM Components.
    System will create this reservation automatically.
    For Manual creation of reservations - I guess the T.Code is MB25(I am not very sure). You can serch in easy access menu..
    Regards,
    Siva

  • How to speed up fast refresh of materialized view without primary key

    Thought I'd share this info, as I couldn't find anything on here to help me diagnose the issue:
    I had a materialized view that was taking longer to perform a fast refresh than it took to perform a complete refresh. My mview had no primary key, as the base table had no primary key.
    I created a trace file for the session and saw references to a column M_ROW$$ in my mview. Nowhere in the data dictionary could I find a reference to the m_row$$ column in my mview, but apparently it exists and is created automatically. After creating the index below, the fast refresh took 6 minutes to add 500k rows to the materialized view. (versus 4+ hours without the index) When I looked in the trace file, I noticed that for each row in the mview log, it first tries to update the mview with an UPDATE statement, then it performs an insert of the new data. Seems like it should be able to determine whether to perform an update or insert based on the DMLTYPE$$ column of the mview log. What was killing my performance was the UPDATE phase. Since I had no primary key on the mview, and no index on the m_row$$ column, the UPDATE phase was performing a full table scan of my mview for every row in the mview log. I was expecting it to be smart enough to only perform inserts, as the only transactions against the base table were inserts.
    In summary: If you have a materialized view without a primary key, create an index on the m_row$$ column of the mview, even though no such column displays in the data dictionary.
    ex:
    CREATE MATERIALIZED VIEW mv_minidrr ...
    CREATE INDEX pk_mv_minidrr ON mv_minidrr(m_row$$) ...

    Well, there indeed is a column called M_ROW$$
    Your MLOG$_EMP is nothing but the materialized view log on the base table.
    SQL> create  materialized view log on emp with rowid ;
    Materialized view log created.
    SQL> create materialized view emp_mview refresh fast on demand with rowid as select * from emp ;
    Materialized view created.
    SQL> desc mlog$_emp
    Name                                                  Null?    Type
    M_ROW$$                                                        VARCHAR2(255)
    SNAPTIME$$                                                     DATE
    DMLTYPE$$                                                      VARCHAR2(1)
    OLD_NEW$$                                                      VARCHAR2(1)
    CHANGE_VECTOR$$                                                RAW(255)
    SQL> select table_name, column_name from user_tab_columns where column_name = 'M_ROW$$' ;
    TABLE_NAME                     COLUMN_NAME
    MLOG$_EMP                      M_ROW$$
    1 row selected.
    SQL>

  • How to create a variant to a maintenance view (trans: SM31)

    Hi gurus.
    I have created a maintenance view (called z_jest). By running it from SM31 there is a variant option. However, I am not able to create the variant which I want to filter a selection upon in this transaction.
    I have even looked into transaction SE54 and created a variant for the maintenance table view there( called z_jestv). Then going back to transaction SM31 and view z_jest, i push 'Variant' radiobutton and type as variant: 'z_jestv', I only get the message: "Variant z_jestv for object z_jest does not exist".
    Can anybody please advice on how to create and/or connect the variant to the maintenance view?
    Regards LL.

    Hi Mahalakshmi
    Thanks for reply.
    When I look into the procedure, there is a prerequisite: "The basis dialog for which the maintenance variant is created already exists."
    I am a little bit unsertain if I miss this 'Basic dialog'. Can you please advice on how to check / create this 'basic dialog' before I go on to create the variant. (I need this 'basic dialog' as input in the procedure you sent.)
    (Note: I have already created a 'maintenance dialog' for the view, but I have a feeling, that is something different...)

  • How to create wizard for a custom mainenance view/view cluster

    Hi Experts,
    I have created 5 custom maintenance view and have maintained all the views sequencially and have made the first mainenance view as the start view & header entry and all other views are child or subview of the header view in a custom view cluster. But I want a wizard to help the user / end user successfully enter all the required values for all child views, it will help  the user to navigate  from the start view to all the child views where the fields of the wizard will be associated to the child maintenance views.
    Please suggest how to create wizard for view cluster.
    I'll give max reward point for the helpful answer.
    Thanks in advance
    koustav

    Hello Pasapula
    When you are in the View Cluster maintenance dialog (SE54) click on dialog "Events".
    Below the field for the view cluster you have an additional field <b>FORM routines main program</b>. There you have to add the main program containing the FORM routines called by the VC events.
    For example: I had defined a normal report containing an include with all the FORM routines. The report contains only the following lines of coding:
    report zus_0120_u1.
    * Common Data und access routines for user exits in VC maintenance
    include LSVCMCOD.
    include  zus_0120_f1. "FORM routines for VC events
    Now in the "Events" dialog of the view cluster maintenance you assign your FORM routines to the events.
    Regards
      Uwe

  • How to create LOV not based on a View Object attribute?

    Hi,
    I am creating a handed-made search form and I want to create an af:inputListOfValues.
    I have :
    - a read-only-view-object to get the LOV values from BD.
    - af:inputListOfValues tag (droped from Component Palette).
    How can I create the listOfValuesModel in Bindings layer? (the inputListOfValues is not based on a View Object attribute).

    Sorry, I think I am not very clear in my posts.
    My requirement is to create a LOV but I have no ViewObject. I just want an input (not based on a view object attribute), alone, but with a LOV (where lov's datas are get from a view object).
    In a "normal" LOV I would have something like this :
    in jsff :
    <af:inputListOfValues id="departmentIdId"
                                popupTitle="Search and Select: #{bindings.DepartmentId.hints.label}"
                                value="#{bindings.DepartmentId.inputValue}"
                                label="#{bindings.DepartmentId.hints.label}"
                                model="#{bindings.DepartmentId.listOfValuesModel}"
                                required="#{bindings.DepartmentId.hints.mandatory}"
                                columns="#{bindings.DepartmentId.hints.displayWidth}"
                                shortDesc="#{bindings.DepartmentId.hints.tooltip}">
            <f:validator binding="#{bindings.DepartmentId.validator}"/>
            <af:convertNumber groupingUsed="false"
                              pattern="#{bindings.DepartmentId.format}"/>
          </af:inputListOfValues>in pageDef :
    <listOfValues StaticList="false" IterBinding="EmployeesView1Iterator"
                      Uses="LOV_DepartmentId" id="DepartmentId"/>in model layer : a view object (EmployeeView) with view accessor and LOV based attribute, and a read only view object (DepartmentRVO) to get datas for the LOV.
    But in my case I have no ViewObject, so I don't know how to create the listOfValuesModel in fragment pageDef.
    I have :
    <af:inputListOfValues label="Label 1"
                                    popupTitle="Search and Result Dialog"
                                    id="ilov1" model="here I want to point to a listOfValuesModel but I don't know how to create it"/>in pageDef : the listOfValuesModel but I don't know how to create it.
    in model layer : just a read only view object (like DepartmentRVO), to get the datas for the LOV.
    Edited by: h0s on 29 févr. 2012 00:31

  • How to create transport request of Dynamic Selection view.

    Dear Freinds,
    I have created a dynamic selections view form Se80 > Editobject>Selection view > Created by adding the required tables pa0002,pa006,pa0009 . But the transport request saved it locally now i want to create a transport request for the dynamic view . Could any please let me know how to create transport request for the Dynamic selection View which has been created or could any please let me know where this dynamic selection gets stored?
    regards
    divya

    Hi Kalyan,
                    In se80> editobjects > selection view .........i have created the selection view . Now i have went into se80 and i dont find the one you have told me . could you please let me know little bit clear where i have to see .
    regards
    divya.

  • How to create a guest access to Adobe Viewer?

    Hi,
    My customer and I want to create a new magazin and I want to
    give my customer a feedback of tests and designs.
    Can I create a guest access to Adobe Viewer?
    I want my customers to provide the resulting app to jointly discuss
    the same changes and tests. But do not want the customer generally
    has access to my Adobe ID. Is there a way for this?
    maybe there would be a general solution other 'm open to everything.
    But I would like to remove my customers to provide the resulting app
    to examine and test.
    best regards, Liljana
    Nachricht geändert durch Liljana***

    You can ask your customer to ceate an Adobe ID and then you can share your specific work/folio with that Adobe ID. So this way you need not share your Adobe ID/Password with the Customer and Customer also need not to share their password/other details with you.The best part is whenever you make any changes in your folio the shared user automatically get that change. User just has to take the update.

  • Want to see real time materialized view example

    Hi all
    i m d beginner with the pl/sql and want to know some real time scenario of materialized view ..i go through some examples on Database journal...but still oif u can help me for that it been great for me
    thanks
    rommy

    and want to know some real time scenario of materialized view What do you mean by "real time scenario"?
    What are you looking for that you didn't find in the examples?

  • How to create a composite nonclustered index using sql server management studio

    Hi,
    How do I create a composite non clustered index using Manage Index and Keys dialogue box?
    sukai

    See image below:
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to create the JOB SEARCH INDEX in multi-language?

    Hi, my company is using Peoplesoft HRMS 8.8 with the recruiting solution. We have a problem in job searching for the langauage other than English. The problem is that the index for other language can't be built. Do anyone know how to do it?

    Hi Ashutosh,
    If you need to run only Info Package, you can schedule it in background. Otherwise if it needs to be followed by further processes like Data Activation or Compression, better you can create a Process Chain.
    To schedule an Info Package in Back Ground, go through the following steps.
    1. Go to the Scheduler Tab of InfoPackage.
    2. Select the Radio Button "Start Later in Back Ground"
    3. Click on "Scheduling Options".. Here you can schedule it in   Five differeng ways. a)Immediate  b)Data/Time c)After Job 4)After Event 5) At Operation Mode
    4. Select the desired option and enter the values. If you want this load to run repetitively, you can select the option periodic job. (Like hourly, daily, weekly etc..)

Maybe you are looking for

  • AddAppUser can't associate more than 2 groups

    Has anyone experienced this with this new AXL API on CUCM 7.0? When trying to associate more than 2 groups with an application user, AXL responds with: Could not insert new row - duplicate value in a UNIQUE INDEX column the original request is: <axl:

  • MC46 & MC50

    Hi All, Can anyone throw light on these two standard reports 1) MC46 - Slow Moving Items 2) MC50 - Dead Stocks Do these two transactions consider 601 Movement Type or any Ales relevant movements. Thanks & Regards, Vinod

  • Feedback page for iPhone???

    Hello, I was just going to leave feedback about an iPhone problem, but the only Operating systems offered in the drop down box are for Mac and Windows. What are we supposed to enter there? Thanks.

  • Error when using F9

    We have a problem with Outlook 2013 integration. Couple of users are facing the issue. We are on Application Version: 8.1.1.11 SIA [23030]. .When user hits F9, Outlook gets the message and opens the editor as expected. However, when he sends the lett

  • Photoshop Elements 13 do'nt work in edtit mode

    I have installed Photoshop Elements 13 under WIN7 the Organizer function works fine. If I open the edit Funktion I get the following Error Massage: Problemereignisname: APPCRASH   Anwendungsname: PhotoshopElementsEditor.exe   Anwendungsversion: 13.0.