Hiding a column from materialized view

Hello All,
I have created a materialized view which aggregates the monthly wise data, as we know, for refresh on commit of this view i have selected count(*) and count(col).
My problem is i don't want these columns to appear in the materialized view.
regards

If you include the columns in the select statement that generates the materialized view they will be visible. So your choices are:
(1) don't include them in the query
(2) overley the materialized view with a plain view.
Apparently you don't like option 2, which leaves option 1. I must confess I don't understand your original post, so maybe you could explain in more depth why you have these columns you don't want. There may be some other way of achieving your aim.
Cheers, APC

Similar Messages

  • How to add new columns in materialized view

    We are using Oracle 10g Release2.
    We need to add new columns to a prebuilt fast refresh materialized view. We want to add 4 new columns in this table and make them part of select statement in the materialized view. We can drop the view but we cannot do complete refresh after that because the paymentsInfo table has a creation_timestamp column which is populated by before row insert trigger with systimestamp. If we did the complete refresh, all values in this column shall be changed.
    CREATE MATERIALIZED VIEW  paymentsInfo
    ON PREBUILT TABLE
    REFRESH FAST
      ON DEMAND
      START WITH SYSDATE
      NEXT SYSDATE+5/1440
      WITH PRIMARY KEY
    DISABLE QUERY REWRITE AS
    SELECT PAYMENT_ID,BATCH_REFERENCE, TRANSACTION_REFERENCE, NO_OF_TRANSACTIONS, DEBIT_ACC_NUM,... from payment@dblink
    I want to know is there any other way to add new columns without losing any changes from the master table.
    Thanks.

    There is no way to add new Columns to Materialized view. To add new columns, it has to be dropped and re-built again.
    Extract from Oracle Documentaion:
    Use the ALTER MATERIALIZED VIEW statement to modify an existing materialized view in one or more of the following ways:
      To change its storage characteristics
      To change its refresh method, mode, or time
      To alter its structure so that it is a different type of materialized view
      To enable or disable query rewrite
    If you have a problem of Complete refresh, then It may be beneficial to get the backup of the MView; Drop and re-create it with modified definition; Restore the backup data leaving the new columns untouched (assuming they are to be kept as fetched from the Master site).

  • Identifying updated column in materialized view logs

    Hi all,
    I created a materialized view log for a table with three columns(say colA,colB,colC). Is there any way to identify which column got updated among these three columns? through the entries in mat view logs?
    any inputs on this ll be of great help.
    Thanks in advance.
    gopi

    Can someone tell me about M_ROWS$$ column in Materialized view.
    I am in confucion.

  • Invalid Column Name on select from materialized view?

    Hey all, I have created this materialized view for my java to select from. For some reason when I try to select from it, I get invalid column name. Here is my mat view statement in its simplest form:
    create materialized view mv_pgridtcevcluster_property as
    select distinct clustername_ as "OBJECT_ID", CLUSTERNAME_, LICENSEMODE_
    from p_gridtcevcluster p
    order by clustername_;
    Now when I run my select statement from jdbc:
    SQL: select object_id from MV_PGRIDTCEVCLUSTER_PROPERTY
    java.sql.SQLException: Invalid column name
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
         at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3319)
         at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1926)
         at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
         at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342)
         at historian.objects.mgmt.udrManagerTest.gatherObjects(udrManagerTest.java:73)
    Anyone have issues with this before? It seems to throw the error sporatically, any help would be much appreciated!
    Regards,
    TimS
    Edited by: TimS on Mar 30, 2009 1:54 PM
    Nevermind, figured it out. Was using wrong column name identifier when picking values from resultset.

    Since you have "OBJECT_ID" in quotes, Oracle stores the column name literally and case sensitively, and the column name must be capitalized when referenced.
    From a regular sql*plus window, try
    select object_id from mv_pgridtcevcluster_property;
    select OBJECT_ID from mv_pgridtcevcluster_property;
    select "OBJECT_ID" from mv_pgridtcevcluster_property;What is the result from each of them?

  • Moving data from Materialized View to downstream application

    Database Version: 9i Release 2
    I've created a Materialized View on a base table, the purpose of which is to capture data changes to send to a downstream application
    (I've been advizsed to avoid using Streams for now until we upgrade to 10g)
    I need to either:
    a) Make that data available for another process to pick up and have knowledge of what it needs to pick up versus what it has already picked up
    or
    b) Send/Update a table or MV at a downstream MS SQL Server database (resides within our firewall)
    Some notes/questions
    I cannot change the structure of the underlying base table
    On the MV I could capture a date-time which records each time a record is touched on the base table, the problem is that many of these updates are “meaningless” and I should not send such updates downstream
    1.Is there a way I can timestamp/flag the records as they get inserted/updated on the MV? (potentially used by the pickup process to identify what it needs to pick up)
    2. If I flag the records e.g. “needs pickup” – would it be ok to make the MV updateable so the process can then mark the records as “picked up”. Performance?
    3. Can I create a trigger on the MV to write records to a secondary table as they are inserted/updated on the MV?
    4. Could I use the MV log tables MLOG$ to help me in any way?
    I’m guessing there is no way to do the following but:
    5. Is there a way to include a column on a Materialized View but ignore it in terms of capturing changes. e.g. I have columns a,b,c,d,e on my base table, I want to include a,b,c in my Materialized View but I only want my MV to be updated if a or b is updated on base table. If only column c is updated do not send any update to MV
    Many thanks for any insight

    Yes I do have a unique identifier on each record in the base table and therefore also in the MV.
    So now the Downstream application has to update some of its own database tables based on what is in the MV that I provide - just so I understand how would that work e.g.:
    1. MV gets refreshed from my base table every minute
    2. Some records are newly inserted and some simply updated
    and this is the part I don't understand (I might be missing something obvious)....
    3. Downstream application interrogates the MV every (say 1-2 minutes) and updates its own tables based on the data there.....but let's say MV contains 10,000 records and in the last minute 100 of those records have been updated and another 100 inserted - how will it know the 200 records it needs to pull?
    Thanks again

  • ORA-00957 Duplicate Column Name Materialized View  ( UPDATED: Not answered)

    Hello all.  I am getting this error when trying to create a Materialized View.  I have many other MV I created without problem, but I cannot find the catch up here, can anyone help?.  I cannot find any duplicates. The only duplicate I though was the Pipeline_Code column that was entered into the function and the one being being called out as a column. To check, I renamed the latter and still am getting this issue.
    Any help would be greatly appreciated.
    Thanks!
    The query is below:
    CREATE MATERIALIZED VIEW MV_TEST_STATION
    REFRESH COMPLETE
    START WITH TO_DATE('20-SEP-2013 00:00:00','dd-mon-yyyy hh24:mi:ss')
    NEXT (SYSDATE +12/24)
    AS
    SELECT T.TEST_STATION_ID,
           --(SELECT TEST_STATION_TYPE.DESCRIPTION
            --  FROM TEST_STATION_TYPE
           --  WHERE TEST_STATION.TEST_STATION_TYPE =
               --       TEST_STATION_TYPE.TEST_STATION_TYPE)
             --AS TEST_STATION_TYPE,
            TST.DESCRIPTION AS TEST_STATION_TYPE,
           T.SURVEY,
           T.STATUS,
           T.STATION,
           F_TRUESTATION2 (
              T.STATION,
              T.PIPELINE_CODE,
              F_REROUTE_CODE (T.STATION,
                                      T.PIPELINE_CODE))
              AS TRUE_STATION,
           T.REQUIRED,
          -- (SELECT PIPELINE_CODES.PIPELINE_CODE_DESCRIPTION
           --   FROM PIPELINE_CODES
            -- WHERE TEST_STATION.PIPELINE_CODE = PIPELINE_CODES.PIPELINE_CODE)
           --   AS PIPELINE_CODE,
           PC.PIPELINE_CODE_DESCRIPTION AS PC_PIPELINE_CODE,
           T.INSTALL_DATE,
           T.FUNCTIONAL COMMENTS,
           TSR.TEST_STATION_READING_ID,
           TSR.TEST_DATE,
           TSR.SURVEYOR,
           TSR.ON_VOLTS,
           TSR.ON_BG,
           TSR.ON_AG,
           TSR.METER_UTC,
           TSR.METER_ID,
           TSR.IO_BG,
           TSR.IO_AG,
           TSR.INSTANT_OFF_VOLTS,
           TSR.FUNCTIONAL_DAMAGE_OUT,
           TSR.FUNCTIONAL_DAMAGE_IN,
           TSR.COSEMETIC_DAMAGE_OUT,
           TSR.COSEMETIC_DAMAGE_IN,
           TSR.COMMENTS,
           TSR.CASING_ON,
           TSR.CASING_OFF,
           TSR.CASING,
           TSR.CALIBRATION_DUE_DATE,
           TSR.ANODE_AMPS_ON,
           TSR.ANODE_AMPS_OFF,
           TSR.ANODE
      FROM TEST_STATION T
    INNER JOIN TEST_STATION_TYPE TST ON T.TEST_STATION_TYPE = TST.TEST_STATION_TYPE
    INNER JOIN PIPELINE_CODES PC ON T.PIPELINE_CODE = PC.PIPELINE_CODE
      INNER JOIN TEST_STATION_READING TSR ON T.TEST_STATION_ID = TSR.TEST_STATION_ID
    WHERE T.TEST_STATION_ID = TSR.TEST_STATION_ID

    since we don't have your tables or data, we can not run, test, fix or  improve posted code
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002

  • Execute Immediate. Insert from materialized view.

    Hi,
    I'm using Execute Immediate in a function to insert rows into a table. (Oracle 10G) The function in tern is used in a materialized view. So, effectively the view does an insert.
    When I just had a regular insert statment the view would not compile. When I changed the insert statment into the execute immediate it started working.
    Here are my questions:
    1. Do I need a commit or execute immediate does it automatically? When I create my view that calls the function it looks like the rows do get inserted as expected. But I couldn't find documentation that explains whether execute immediate does the commit.
    2. Is there a drawback to using execute immediate in a function that is used in a materialized view? Is there other way to insert rows from a materialized view? Can I call a stored procedure instead of a function in a materialized view?
    Your help is greatly appreciated.
    Thanks
    NK

    there are things that I'm not able to question yet :)It's a lot easier to write decent programs if we understand the why of the requirement as well as the what. I think you will create a better impression in your new job if you demonstrate some liveliness of thought and personality - by asking questions - rather than merely following orders.
    The question I proposed is not necessarily a hostile one (I can think of at least one good reason for doing what you've been asked to do). Broadening your knowledge of your new system is a good thing in its own right. But you never know, asking the right question may prevent you doing unnecessary work.
    Cheers, APC

  • [help]why data on table (master ) different  from materialized view(slave)?

    We have had Oracle RAC 2 Groups (master and slave).
    We have created materialized from slave to master. and I have created materialized view log on master .
    When slave group job is broken a long time(12 Hrs). We refreshed job and runned job id.
    But I have found database on materialized view (slave) different from TABLE on master group. (m$log =0row)
    Please tell me how can we resolve Or because that problem is m$log

    Yes I do have a unique identifier on each record in the base table and therefore also in the MV.
    So now the Downstream application has to update some of its own database tables based on what is in the MV that I provide - just so I understand how would that work e.g.:
    1. MV gets refreshed from my base table every minute
    2. Some records are newly inserted and some simply updated
    and this is the part I don't understand (I might be missing something obvious)....
    3. Downstream application interrogates the MV every (say 1-2 minutes) and updates its own tables based on the data there.....but let's say MV contains 10,000 records and in the last minute 100 of those records have been updated and another 100 inserted - how will it know the 200 records it needs to pull?
    Thanks again

  • Oracle Dictionary: check what table belongs a column from a view

    hi,
    Is there any way to check in the oracle data dictionary what is the table that a column in a view belongs to?
    Imagine this
    create view xpto as
    select table_a.col1, table_a.col2, table_b.column1
    from table_a, table_b
    I want to know that column1 in the view xpto belongs to the table_b.
    Is this possible? How?
    Best Regards,
    Joao Oliveira

    Hi Mat,
    I know that I can check the table columns in that view or in user_Tab_columns. The problem is that some views have columns from different tables that have the same name. Understood?
    So I really need to know what tables are part of the view query.
    Thanks
    Joao

  • VA01 and from material view and last SO it shows wrong last sales price

    Hi,
    In sales order condtions the current flow is as follows:
    sales price PR00 - 8.36
    insurance ZZC0 - 0.03
    So the total value is 8.39 inr.
    But the client requirement is, the total value should be 8.36 only.  Insurance value should not add to the net price, but it should display in sales order condtions.
    we can do the pricing as statistical in pricing procedure for insurance.  But  client is not accepting for that.
    please letme know is there any other alternative way to get the required solution.
    look forward for your answers.
    thanks in anticipation.
    br,
    Hari.
    Moderator message: not directly related to ABAP development, please post again in the appropriate functional forum.(ERP SD?)
    Edited by: Thomas Zloch on Jul 13, 2010 2:43 PM

    When you use the query as a formatted search with auto refresh the query will Populate the Value of the first column from the first row of the query result.  Therefore the user will not see the last 2 prices for which the SELECT statement was created.
    To see the last 2 prices the user has to manually press ShiftF2 which is the same effort as CTRLTab.
    Writing a simple SQL is easy but it is important to educate the client with the benefits of using out of the box functionality when one already exists
    -Suda

  • Generate insert statement using columns from all_tab_cols view

    i am trying to generate a dynamic insert statement using the columns for a table from the all_tab_cols view. if i do a select, i get the output as rows. How do i convert the row out to columns so that i get something like this : INSERT INTO TABLE_NAME (COL1, COL2, COL3,COL4.....) .
    Any help will be appreciated!

    SQL> select * from my_test;
    no rows selected
    SQL> desc my_Test;
    Name                                      Null?    Type
    COL1                                               NUMBER
    COL2                                               NUMBER
    COL3                                               NUMBER
    SQL> declare
      2  cursor c1 is select column_name from all_tab_cols where table_name = 'MY_TEST';
      3  v_sql VARCHAR2(10000) := NULL;
      4  v_cnt NUMBER := 0;
      5  BEGIN
      6  FOR I in C1 LOOP
      7  v_cnt := v_cnt + 1;
      8  v_sql := 'INSERT INTO my_test('||I.column_name||') values('||v_cnt||')';
      9  EXECUTE IMMEDIATE v_sql;
    10  END LOOP;
    11  COMMIT;
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    SQL> select * from my_Test;
          COL1       COL2       COL3
             1
                        2
                                   3
    SQL>

  • How can I display the descriptor column from a view in my BR message

    I have a table, Memberships, that contains a column for staff id. The staff data is on a remote database and I have created a view to access the required data. I have set the descriptor sequence for the name column of the staff view but the BR still displays the id.
    I'm assuming that because staff is a view and has no capi of its own, the membership capi cannot call the staff capi function display_label.
    I still would like to display the name of the staff member instaid of the ID. Can anyone suggest a workaround to force the display but without having to customize the membership capi after it has been created by headstart?

    Hi,
    try altering the code to create the capi.
    I modified this code allready quite a lot to achieve my goals.
    I also had that problem, and solved it by altering the code that generates the display_label. For each display_label funtion, I add a call to a package- function 'APPPA_LABEL.display_label' with parameters the tablename and the pk of the record. In the packagefunction, you can write your own definition of the display-label.
    The Productivity Boosters look a bit difficult in the beginning, but when you get to know them, you can achieve some good results.
    Greetings,
    Kristof

  • Ability to query on all columns from a view with multiple tables

    I have view with 4 tables. view has about 50 columns.
    hypothetically, I want to build a form to give the user an ability to query on any of those 50 columns. user can search on one or more fields.
    what is the best way to write the query to retrieve the results without performance impact.
    please let me know if the question is not clear.

    If you want to permit them to query any of 10 fields with no restrictions, you could create 10 separate single-column indexes. The optimizer would have to try to pick the best of these indexes if you specified multiple search criteria. But since you have a view which presumably means that you've got multiple other indexes involved for the underlying join conditions, you'd probably want/need to combine the column lists of the indexes you're adding for searches with the indexes you've created for joins, which requires looking at the text of the view and figuring out the best way to optimize the 10 single-column searches. Of course, it is possible that the optimizer could chose to do something like a b-tree to bitmap conversion on multiple indexes which could allow it to use multiple independent indexes for your queries, but that's generally not ideal performance-wise.
    All this is a fancy way of saying that there probably isn't a cut and dried answer to your question. You need to figure out the queries you're trying to optimize (say, the 10 single-condition queries) and you need to figure out what set of indexes on the various underlying tables provides the best performance weighing those benefits against the cost on other side of maintenance during DML. Which is going to depend on the text of the view, the underlying tables, the existing indexes, etc.
    Justin

  • Hiding custom column in Weekly view of the Time Entry in ESS

    We have added a custom field to time entry (CAT2). This field is displaying in both (weekly and daily) view of the time entry screen in ESS. Our requirement is too display the field only in daily view.
    Is there a way to hide the custom column in the weekly view of the time sheet in ESS?
    Thank you,
    Rohit

    well it would require modification to the iview , it wont be a easy quickfix cause you lauch the iview it is built using CAC2 field customisation
    you can explore Personalisation for the daily view hope it can work!

  • Hiding entry pages from the viewer in a Podcast page

    I have a podcast page displaying a series with 4 episodes. I want the viewer only to use the "subscribe" button. I do not want them to go anywhere else by clicking on the links on the page that take them to the entry pages. If they click on "more" it takes them to an entry page where they can download the podcast. Is there any way I can prevent them from doing this? For viewers new to podcasting this alternative offering is very confusing ?

    Thanks for your reply, Ken. I did start a separate topic for this but it didn't seem to publish properly.
    I've posted it again here:
    https://discussions.apple.com/message/19816933#19816933
    I assume you don't know why this is happening to my TOC?

Maybe you are looking for

  • Can't use mobile hotspot

    "use of this service requires a subscription to mobile hotspot" so i'm getting that when i should've been able to use the mobile hotspot. anyone knows anything at all about this issue?

  • How to configure Use tax in the system

    Hi , As in use tax , the tax amt should be paid by the buyer  to the govt... we r using taxware... so let me know how to configure the tax codes.. normally the entries will be expenses dr, tax dr and the full amt will go to vendor cr.... but here the

  • TS1424 ITune download continues to process but doesn't complete. What could be the issue

    ITune download continues to process but doesn't complete. What could be the issue

  • Install CS6 Applications via SCCM Task Sequence

    Hi We have an SCCM 2012 R2 infrastructure on our network, and want to deploy Adobe CS6 applications using Windows Installer Packages created with Adobe Application Manager Enterprise Edition 3.1 We created individual packages for each application (fo

  • [solved] clanbomber2 aur misses it's md5sum

    Hi All, I'm trying to compile clanbomber2. the origional aur failes: cedric@laptop:/storage/home/cedric/download/clanbomber2$ makepkg ==> Making package: clanbomber2 0.9.1-1 (Tue Aug 3 00:30:19 CEST 2010) ==> Checking Runtime Dependencies... ==> Chec