I need to create a meterialized view.

hey guys,
i need to create a mv for one of my large database table and that should be refresh for every 30 min. so can you plese give me some syntax.
thanks in advance,
Lakshman.

If you look up the documentation (which you can find at http://tahiti.oracle.com) You will get all the syntax you'll ever need

Similar Messages

  • Need to create a vertical view from horizontal table w/delimited column

    I would like to create a vertical view frm a table that has a colon delimited column.
    I can get a single row to work. I need the level to reset to 1 when the row changes.
    any Ideas? the key to the table is: sos,nr,prgm_cd,mth
    here is my select for a single row w/where clause removed:
    SELECT SOS,NR,PRGM_CD,trunc(sysdate-(30*LEVEL) , 'mm') MTH,
    ADD_MONTHS(trunc(sysdate,'q'),-3*LEVEL) QTR,
    SUBSTR(qty,
    INSTR(qty,':',1,LEVEL) +1,
    INSTR(qty,':',1,LEVEL+1) - INSTR(qty,':',1,LEVEL)-1) QTTY
    FROM (SELECT SRC_SUPL_CD SOS,APPL_PRGM_DESIG_NR,TYP_PRGM_CD,':'||PAST_PRGM_QY||':' qty from
    rssp_api_master )
    CONNECT BY LEVEL < LENGTH(qty) - LENGTH(REPLACE(qty,':'))
    ex. data
    sos nr prgm_cd qty
    aaa 3 xx 1:2:3:4:5:5
    bbb 3 xx 9:10:11:12:13
    need to look like this
    aaa 3 xx 1
    aaa 3 xx 2
    bbb 3 xx 9
    bbb 3 xx 10
    bbb 3 xx 11

    See this thread
    Re: rows into column
    Nicolas.

  • How to create a buy view??

    Hello,
        i  need to create a buy view in a material. I found a function called BAPI_MATERIAL_MAINTAINDATA_RT but it don´t create the buy view.
    Any idea?
    Thanks!

    Hello,
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = T_HEAD
    PLANTDATA = T_MARC
    PLANTDATAX = T_MARCX
    STORAGELOCATIONDATA = T_MARD
    STORAGELOCATIONDATAX = T_MARDX
    SALESDATA = T_MVKE
    SALESDATAX = T_MVKEX
    IMPORTING
    RETURN = T_RETURN
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = T_RETURN

  • How to create a new view by copying from standard view in IC webclient?

    Hello, expert,
    I need to enhance a sap standard component (BP_Factsheet), inside it I need to create a new view by copying from an existing standard view (Acitivities). However when I try to make a copy, I was asked for destination BSP application, I entered the Z-Application which I used when defining enhancement for the component. After the copy, I don't see the new view.
    Then I tried the destination BP_factsheet, instead of the z-application, then after the copy, I can see the new view. However since it's in SAP application, it seems like it's a MOD, not enhancemnet, and inside the new view, the classes (for context, context nodes, etc.) are not in custom namespace (not starting with Z).
    So please let me know how can I make a copy of sap standar view in custom namespace.
    Thanks in advance.
    Jayson

    When copying you can put any BSP name..normally the practice is to prefix the standard name with a Z.
    Secondly when you want to make changes to the individual classes and methods you need to right click and say enhance. Then the AZ class names etc would be generated. The view should appear in the component wherein you copied the original view from.
    I hope this helps.
    The cookbook should have details on this. Otherwise also its quite intuitive.
    Award points if it helps.
    Thanks.

  • Creating a new view to search local database

    SA
    i need to create a new view that searches my local db for certain clumns
    and i need the filter to have drop down lists based on my instace variables objects
    any suggesstions please ?

    You cannot implement that functionality using the Workspace views. I suggest having a screenflow that uses a JSP to display the information in the way you want. This screenflow can be exposed as a global activity.

  • Create a new view in Material Master

    Hi All,
        I need to create a new view in the Material Master (Tcode - MM*)
    Can anyone let me know how can this be attained. Can this be attained by configuration.
    Regards
    Simin.R

    you have to use the MM01 tocde and enter the mateial you want extend for new view. system will propose the view and select the new view.
    Or use MM50 for mass

  • How to create the classification view to the customer ?

    Hi All ,
    I need to create a classification view  (Xd03->extras->classification) to the customer in the customer master programmatically. I.e. for an existing customer , I need to  assign the class and corresponding characteristic  values  based on a condition .
    1) Is there a BAPI or FM that assigns the class and characteristics to the customer ?.
    2)When  there is no classification data for a customer , Xd03-extras-> classifications   will give  a message that Class is not assigned . How SAP Is reading this data?
    3)What is the table that I can see the  link B/w Customer  and class ?
    It is urgent , Please help Me .
    Thanks in advance ,
    Dharma .

    Hi Dharma,
    i've got the same problem.
    On my search through DDIC I found table KSSK with key: CLINT and OBJEK (customer number).
    Perhaps it helps
    I solved the prob with the FMs BAPI_OBJCL_CREATE and BAPI_TRANSACTION_COMMIT.
    Kind Regards
    Markus
    Edited by: Markus Pawlinka on May 30, 2008 9:32 AM

  • 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

  • Need to create tree-view page.

    I'm trying to create a tree-view display using Oracle JDeveloper 10g Release 3, ADF and JSF.
    I need to show a tree (folder names) and on a click of the last level folder to show table with File names that are related to the selected folder.
    Data is stored in two tables:
    1. contains Folder names and hierarchy relations;
    2. contains File names.
    These tables related by folder ID.
    Using ADF Faces Component, I created a 3 level Tree that expends and collapses each level of Folder names but I don't know how to populate the View part (table with File names). Basically, I need to take an ID of the selected row in the Tree and pass it as a parameter to the View table query where clause.

    Since this is not a hibernate forum i suggest you ask your question about hibernate somewhere else.

  • Need to create view ( Urgent )

    Hi All,
    I have one requirement to create a view .Presently we are using a packaged procedure(view_test_123_pkg) to extract part numbers to write to a file using utl_file package.
    Now the requirement is to create a single column view to extract part numbers exactly as package (view_test_123_pkg) is extracting .
    below is the package details and view which I have created .Please help
    CREATE OR REPLACE package APPS.view_test_123_pkg
    as
    procedure create_part_ref_proc;
    end;
    CREATE OR REPLACE package body APPS.view_test_123_pkg
    as
    procedure create_part_ref_proc
    as
    l_s_part varchar2(50);
    L_CUST_PART varchar2(50);
    l_cat varchar2(10);
    l_partner_id varchar(30);
    l_bare_part varchar2(50);
    l_last_bare_part varchar2(50);
    l_line_print varchar2(500);
    l_last_s_part varchar2(50) :='newww';
    l_last_c_part varchar2(50) :='newww';
    l_last_cat varchar2(10) :='newww';
    l_count number;
    l_revision varchar2(50);
    l_cust_revision varchar2(100);
    l_error_code number;
    l_error_text varchar2(200);
    l_error_msg varchar2(1000) := '';
    l_returned number := NULL;
    --===================================================================
    -- CURSORS TO READ TABLES
    --===================================================================
    Cursor part_find is
    select distinct
    customer_part_number,
    internal_item_number,
    corp_code cat,
    bare_item_number,
    customer_revision_number revision,
    CUSTOMER_PRIORITY
    from APPS.customer_part_ref a
    where NVL(PUBLISH_YORN,'Y') = 'Y';
    -- order by 3,2,6 desc;
    BEGIN
    l_count := 0;
    l_last_bare_part := null;
    For rec in find_part
    LOOP
    l_s_part := rec.internal_item_number;
    L_CUST_PART := rec.customer_part_number;
    l_cat := rec.cat;
    l_bare_part := rec.bare_item_number;
    l_revision := rec.revision;
    if instr(L_CUST_PART,'~') = 0
    THEN
    L_COUNT := L_COUNT + 1;
    IF l_last_s_part != l_s_part OR
    l_last_cat != l_cat
    then
    IF l_count > 1
    then
    IF l_last_bare_part is NULL
    then
    l_line_print := l_line_print||'"';
    end if;
    l_line_print := l_line_print||l_cust_revision||'"';
    write(r_file, l_line_print);
    l_last_bare_part := null;
    END IF;
    l_line_print := L_CUST_PART||'"'||l_s_part||'"'||l_cat||'"';
    l_cust_revision := l_revision;
    IF l_bare_part is not NULL
    THEN
    dbms_output.put_line('bare part is not null');
    l_line_print := l_line_print||L_BARE_PART||'"';
    l_last_bare_part := l_bare_part;
    END IF;
    END IF;
    IF l_last_s_part = l_s_part AND ----------------------need help here for the same internal_number need but diff customer_part_number need to get one string
    l_last_cat = l_cat AND --------example CUst_part1 | cust_part2 | internal_part
    l_last_c_part != L_CUST_PART
    THEN
    l_line_print := L_CUST_PART||'|'||l_line_print;
    l_cust_revision := l_revision||'|'||l_cust_revision;
    END IF;
    IF l_last_s_part = l_s_part AND
    l_last_cat = l_cat AND
    l_last_bare_part is NULL AND
    l_bare_part is not NULL
    THEN
    l_line_print := l_line_print||l_bare_part||'"';
    l_last_bare_part := l_bare_part;
    END IF;
    l_last_c_part := L_CUST_PART;
    l_last_s_part := l_s_part;
    l_last_cat := l_cat;
    END IF; -- End of instr('~')
    END LOOP;
    IF l_last_bare_part is null
    THEN
    l_line_print := l_line_print||'"';
    dbms_output.put_line(l_line_print);
    END IF;
    l_line_print := l_line_print||l_cust_revision;
    dbms_output.put_line('after loop');
    write(r_file, l_line_print);
    dbms_output.put_line(l_line_print);
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    raise_application_error(-20999,
    'An unknown error has occured ');
    END;
    end;
    view :::
    create or replace view test_123_view as select distinct
    case when instr(partner_part_number,'~') =0
    then
    case
    when bare_item_number is null
    then customer_part_number||'"'||internal_item_number||'"'||corp_code||'"'||bare_item_number||'"'
    end
    end
    as part_string
    from APPS.CUSTOMER_PART_REF a
    where NVL(PUBLISH_YORN,'Y') = 'Y';
    need to amend the if condition
    IF l_last_s_part = l_s_part AND
    l_last_cat = l_cat AND
    L_LAST_C_PART != L_CUST_PART
    THEN
    to the above view
    I appreciate any help .
    Regards,
    Gopi.ch

    Hello Gopi.ch,
    if it is really urgend, then you should not write so in the title of your post. This is a forum of volunteers and many of the regulars will just ask you why you think it is more important than the other questions.
    Second: you post a lot of unformatted code. This makes it harder to read your question.
    CREATE OR REPLACE VIEW test_123_view AS
    SELECT  DISTINCT
            CASE WHEN INSTR(partner_part_number,'~') = 0 THEN
                CASE WHEN bare_item_number IS NULL THEN
                    customer_part_number||'"'||internal_item_number||'"'||corp_code||'"'||bare_item_number||'"'
                END
            END AS part_string
    FROM    apps.customer_part_ref a
    WHERE   NVL(publish_yorn,'Y') = 'Y';
    need to amend the if condition
    IF l_last_s_part = l_s_part
      AND l_last_cat = l_cat
      AND l_last_c_part != l_cust_part
    THEN
    to the above view I don't want to analyze your package for you, so you might want to tell us where you want to add the condition.
    Regards
    Marcus

  • What kind of view object would I need to create to achieve this ADF form?

    I have an entity that has several dates. The dates are stored in a table separate from the entity, each entity date has a date type (open, close, interview, etc) associated with it. The DBAs idea (who else of course!) was to have the flexibility to add new types of dates for entities when needed.
    So you have tables like this -
    Table: EntityTable
    Columns: EntityId, EntityName
    Table: DatesTable
    Columns: EntityId, Date, DateTypeCd
    I need to display an editable ADF form where I can update the entity and the entity dates
    The ADF form would contain something like this
    Entity Name: []
    Opening Date: []
    Closing Date: []
    Interview Date: []
    What kind of view object would I need to create to achieve this?

    That would be a master-detail relation 1-* between 'entity' and 'entity dates'. If your dba has set up the foreign key association in the db and you use the wizard to create the business objects, jdev pick up the relation and create the correct master detail relation in the vo layer for you.
    By the way naming a table 'entity' is not a good idea when working with ADFbc. We all talk about entities when we relate to a business object (in this case a row of a table or entity object or EO). So it's hard to distinguish the two, your specific table 'entiyt' and the common term entity or EO which can be a row of any table.
    Timo

  • Need to create maintenance view for a custom infotype

    A custom infotype 90XX is created. The data cannot be modified or created through PA30 in this infotype. Through PA 40 actions only we can create/change the record/data. We have created some 1000 records in it. Now can we create a maintenance view for the infotype so that we can create, delete or change the data in the infotype as and when we want.

    Hi,
    pls chk dat u have maintained the 'Infotype Charecteristics' and 'Technical Attributes' correctly.
    thanks,
    teja.

  • M$view need to create with Fast Refersh?

    Hi All,
    I have to create m$veiw with Fast Refresh for only two table join.
    CREATE MATERIALIZED VIEW pup_sub_poc_mv
    REFRESH FAST
    START WITH SYSDATE
    NEXT SYSDATE+(1/48)
    select a,b,c
    from x, y
    where x.id=y.id
    and x.a in (select a from z)
    i am getting below error below error.
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    Is there any way to create Fast refresh view for above query.?

    Try this, I think EXISTS is suported for fast refersh, IN is not - It is Documented
    CREATE MATERIALIZED VIEW pup_sub_poc_mv
    REFRESH FAST
    START WITH SYSDATE
    NEXT SYSDATE+(1/48)
    select a,b,c
    from x, y
    where x.id=y.id
    and exists (select null from z where x.a = z.a)Just got it tested:
    SQL> create materialized view log on emp;
    Materialized view log created.
    SQL> create materialized view log on dept;
    Materialized view log created.
    --"Trying with IN. Error"
    SQL> create materialized view mv2
      2  REFRESH FAST
      3  START WITH SYSDATE
      4  NEXT SYSDATE+(1/48)
      5  as select * from emp where deptno in (select deptno from dept);
    as select * from emp where deptno in (select deptno from dept)
    ERROR at line 5:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    --"Trying with EXISTS."
    SQL> create materialized view mv2
      2  REFRESH FAST
      3  START WITH SYSDATE
      4  NEXT SYSDATE+(1/48)
      5  as select * from emp where exists (select null from dept where dept.deptno = emp.deptno);
    Materialized view created.Edited by: jeneesh on Oct 12, 2012 4:47 PM

  • Meterialized view

    Hi All,
    why we prefer meterialized view than table , if both store query results in the database.
    please clarify my doubt.
    rampa.

    Hi,
    Here are some benefits (advantages) of Materialized Views over normal tables:
    1) Creating a Materialized View populates the data dictionary with the query used to build the Materialized View, while just performing "Create Table As Select" (CTAS) does not. One can run this: "SELECT query FROM user_mviews WHERE mview_name = 'MY_MVIEW';" to see the query used to build that Materialized View - there is no way to do that with a CTAS.
    2) Materialized Views can be directly used for Query Rewrite. Query Rewrite is an advanced feature of Oracle that allows the transparent rewriting of queries to use a Materialized View which may have pre-computed joins and aggregates that the end-user query may otherwise have to perform on-the-fly. Query Rewrite is an implicit feature, much like an index in that the user does NOT need to be aware of its existence to benefit from it. For Kimball-style aggregate tables - the end-user or tool must be aware of the table AND have SELECT permissions granted explicitly.
    3) Materialized Views can be refreshed automatically upon COMMIT on the base tables or manually with a built-in API: DBMS_MVIEW.REFRESH. Additionally, when using Materialized View Logs - Oracle can refresh ONLY the rows that would be affected by the changes made to base tables. This feature is known as "FAST" refresh.
    Refer to the Datawarehousing guide (http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14223/toc.htm) for details on how to use them successfully.
    Hope this helps...

  • How to create a Maintenance view in order to update 4 tables

    Hello,
    I want to update 4 tables having the same key. MANDANT + SIRET (fiscal french ID).
    I try to create a maintenace view, i need to update the 4 tables using a single screen.
    When i use the relationship the system display a message "Relationships with unsuitable cardinality"
    The first table contain only the ID, the 3 others contains some informations (adress, name, and others)
    Thanks for your help
    Christophe

    Hello,
    you could check, if your other three tables have a correct foreign key definition on the field  SIRET.
    Tranaction SE11 -> pstion on the field and press the foreign key button.
    Check Table has to be your first table; cardinality has to be 1 :1 or 1 to N.
    Regards Wolfgang

Maybe you are looking for