Create a view which limits a large table, but also allows an outer join?

Oracle 10.2.0.4

CREATE TABLE MY_PAY_ITEMS

(EMP VARCHAR2 (8) NOT NULL)

, PAY_PRD VARCHAR2 (8) NOT NULL

, KEY1 VARCHAR2 (8) NOT NULL

, KEY2 VARCHAR2 (8) NOT NULL

, LN_ITEM VARCHAR2 (4) NOT NULL

, ITEM_AMT NUMBER (24.2) NOT NULL

VARCHAR2 (100) FILL NON-NULL)

INSERT INTO MY_PAY_ITEMS

SELECT A.EMP

B.PAY_PRD

C.KEY1

D.KEY2

E.LN_ITEM

F.ITEM_AMT

, '                      '

FROM (SELECT TO_CHAR (ROWNUM, ' 00000000') 'EMP' FROM DUAL CONNECT BY LEVEL < = 50) has

, (SELECT '2010-' |) To_char(rowNum,'00') 'PAY_PRD' FROM DUAL CONNECT BY LEVEL < = 52) B

, (SELECT TO_CHAR (ROWNUM, ' 000') 'KEY1' FROM DUAL CONNECT BY LEVEL < = 8) C

, (SELECT TO_CHAR (ROWNUM, ' 000') 'Key2' FROM DUAL CONNECT BY LEVEL < = 5) D

, (SELECT TO_CHAR(ROWNUM,'000') 'LN_ITEM' FROM DUAL CONNECT BY LEVEL < = 20) E

(round (DBMS_RANDOM. VALUE * 400.2) "ITEM_AMT" of the double) F

CREATE A UNIQUE INDEX MY_PAY_ITEMS ON MY_PAY_ITEMS (MEP, PAY_PRD, KEY1, KEY2, LN_ITEM)

CREATE TABLE MY_ITEM_DISPLAY

(THE VARCHAR2 (4) OF DISPLAY_CODE NOT NULL)

, NUMBER (2) SEQUENCE NON-NULL

, COLUMN_ITEM1 VARCHAR2 (4) not null

, COLUMN_ITEM2 VARCHAR2 (4) not null

, COLUMN_ITEM3 VARCHAR2 (4) not null

COLUMN_ITEM4 VARCHAR2 (4) not null)

INSERT INTO MY_ITEM_DISPLAY VALUES ('01 ', 10, '001', '003', '004',' 005');

INSERT INTO MY_ITEM_DISPLAY VALUES ('01 ', 20 '007', '013', '004',' 009');

INSERT INTO MY_ITEM_DISPLAY VALUES ('01', 30 ' 001', '004', '009',' 011');

INSERT INTO MY_ITEM_DISPLAY VALUES ('01', 40, '801 ', ' 304 ', 209',' 111');

INSERT INTO MY_ITEM_DISPLAY VALUES ('02 ', 10, '001', '003', '004',' 005');

INSERT INTO MY_ITEM_DISPLAY VALUES ('02 ', 20 '007', '013', '004',' 009');

INSERT INTO MY_ITEM_DISPLAY VALUES ('02', 30 ' 001', '004', '009',' 011');

MY_PAY_ITEMS is a table that stores line of payslip items.  It has a total area of 500,000,000 lines.

PEM is the unique id, we have about 200,000 employees (with about 50,000 being active today).

PAY_PRD is a weekly pointer (2010-01, 2010-02, 2010-52), we have the 2004 data and add a new pay period each week.  2010 01 is defined as the first Monday in 2010 for the first Sunday in 2010, etc.

Key1 is an internal key, it follows the chronology in the pay period.

KEY2 is a child of KEY1, there follows the sequence of events in KEY1.

LN_ITEM is the component of actual compensation resulting from the event, on average, a person produces 20 lines per event.  Note that in this example, everyone gets the same LN_ITEM values, but in practice it is selected 20 of 300

ITEM_AMT is the net salary per command line.

FILLING is a set of fields that are unrelated to this issue, but act as a brake on the charges of the line.

MY_ITEM_DISPLAY is an array that describes how some screens should display items.  The screen itself is a grid of 4 poles, with the content of each cell is defined as a LN_ITEMS search to retrieve the relevant LN_AMT.

We have an application that receives a DISPLAY_CODE and an EMP.  It automatically creates an sql statement in the sense of

SELECT * FROM MY_VIEW WHERE DISPLAY_CODE =: 1 AND EMP =: 2

and returns the output to the user.

My challenge is that I need to rewrite MY_VIEW as follows:

(1) (select the relevant lines from MY_ITEM_DISPLAY where DISPLAY_CODE =: 1)

(2) select the relevant all MY_PAY_ITEMS lines that meet the criteria

(a) EMP =: 2

(b) PAY_PRD = (a more recent for EMP and sysdate, so if he got last paid 2010-04, return 2010-04)

(c) KEY1 = (highest key1 in EMP and PAY_PRD)

(d) KEY2 = (highest key2 in KEY1, PAY_PRD and EMP)

(3) I then need to cross reference to create tabular output

(4) Finally, I have to return a 0 line where there is no LN_ITEMs (DISPLAY_CODE 01, 40 sequence contains possible values for this scenario)

The following query is part of it (but not the PAY_PRD, KEY1, KEy2)

Select * from)

SELECT A.DISPLAY_CODE

B.EMP

A.SEQUENCE

, MAX (DECODE (B.LN_ITEM, A.COLUMN_ITEM1, B.ITEM_AMT, 0)) 'COL1 '.

, MAX (DECODE (B.LN_ITEM, A.COLUMN_ITEM2, B.ITEM_AMT, 0)) 'COL2 '.

, MAX (DECODE (B.LN_ITEM, A.COLUMN_ITEM3, B.ITEM_AMT, 0)) 'COL3 '.

, MAX (DECODE (B.LN_ITEM, A.COLUMN_ITEM4, B.ITEM_AMT, 0)) 'COL4 '.

OF MY_ITEM_DISPLAY A, MY_PAY_ITEMS B

WHERE B.PAY_PRD = ' 2010-03'

GROUP OF A.DISPLAY_CODE, B.EMP, A.SEQUENCE)

WHERE DISPLAY_CODE = '01'

AND EMP = '0000011'

SEQUENCE ORDER

My questions

(1) how I do PAY_PRD, KEY1, KEY2 forced, can I use a form any of ROW_NUMBER() FUNCTION?

(2) how can I deal with the fact that none of the 4 LN_ITEMS column can exist (see sequence 40, none of these can exist)...  Ideally the SQL above should return

01, 0000011, 10, < a digit - > < number > - < a digit - > < some number >

01, 0000011, 20, < a digit - > < number > - < a digit - > < some number >

01, 0000011, 30, < a number--> < number > - < number > - < number > -

01, 0000011, 40, 0, 0, 0, 0

I tried a UNION, but it prevented the view to eliminate most of the MY_PAY_ITEMS lines, because it solves ALL MY_PAY_ITEMS instead of simply retrieve lines for the EMP passed to the view.  The same seems to be true for outer joins.

Hi Paula,

It does not handle SEQNUM 40, it's just that your second set of test data did not SEQNUM 40. When I put in the first set of values MY_ITEM_DISPLAY, I get:

DISP EMP SEQUENCE COL1 COL2 COL3 COL4

---- -------- ---------- ---------- ---------- ---------- ----------

01 00000011 10 101.1 103.1 105.1 104.1

01 00000011 20 107.1 113.1 104.1 109,1

01 00000011 30 101.1 104.1 109.1 99.99

01 00000011 40 0 0 0 0

If this isn't the issue, you will need to explain the requirement of "outer join" and what you want more. Apart from his return nothing if there is absolutely no element of remuneration of the employee, this query will always return a line for each line MY_ITEM_DISPLAY for the display_code. If there is absolutely no data, no return line seems reasonable.

Tags: Database

Similar Questions

  • How to create relational views based on an xmltype table which included sev

    Hello

    I'm using oracle 11.2.0.1.0.
    How to create a relational view based on a table xmltype including the content of the .xml files several different?

    Thank you.


    For examle:

    SQL > SELECT OBJECT_VALUE FROM document;

    Published by: cow on January 6, 2011 19:57

    In general, you can use XMLTable to create these views...

    You will need to create a view for each collection

    The notice will contain the data of all documents...

  • Create the view with the CLOB of TABLE data type with the LONG data type

    Please need support to create the table view
    Source table: (itemid varchar2, longrec)
    need to create the table view Source
    (itemid varchar2, CLOBrec)

    A BUSINESS object must have a storage in the database, so you can't have a CLOB column in a view by pointing to a not lob data column.

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]

  • Syntax to create the view with 2 inline tables

    Hello

    If I run this SQL, I can compile a view without error:

    CREATE OR REPLACE FORCE VIEW APPS.XX_TEST
    (
        period_name
      , ytd
    )
    AS
    with tbl_data AS
    (
    SELECT '1314-03:OCT' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, -1250 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, 10922 YTD FROM DUAL UNION ALL
    SELECT '1314-02:SEP' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-01:AUG' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1314-00:OBL' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1213-14:CBL' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-13:ADJ' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-12:JUL' period_name, -100 YTD FROM DUAL
    )    SELECT  period_name
               , ytd
            FROM tbl_data;
    

    I need to create a view that includes the 2 tables inline (sorry if this is the incorrect terminology), using this SQL:

    CREATE OR REPLACE FORCE VIEW APPS.XX_TEST2
    (
        period_name
      , ytd
    )
    AS
    with tbl_data AS
    (
    SELECT '1314-03:OCT' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, -1250 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, 10922 YTD FROM DUAL UNION ALL
    SELECT '1314-02:SEP' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-01:AUG' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1314-00:OBL' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1213-14:CBL' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-13:ADJ' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-12:JUL' period_name, -100 YTD FROM DUAL
    ), got_analytics AS
        (
            SELECT  
                period_name,
                ytd,
                ROW_NUMBER () OVER (ORDER BY  period_name)  AS a_num,
                ROW_NUMBER () OVER (ORDER BY  period_name  DESC)  AS d_num,
                FIRST_VALUE (ytd) OVER (ORDER BY  period_name) - FIRST_VALUE (ytd) OVER (ORDER BY  period_name  DESC) AS dif
        FROM    tbl_data
        )
        SELECT  *
           FROM got_analytics;
    

    I get this message:

    ORA-24344: success with compilation error

    There are no other errors but to provide additional information. I am using TOAD.

    I was wondering if it is not possible to create a view in this way, or if I'm missing something?

    I had a peek here:

    ORA-24344: success with Compilation error

    I'm using TOAD, trying to SHOW the ERRORS immediately after the code above only returned 'No Errors'.

    I also looked here:

    ORA-24344: success with compilation error

    Ran the same code SQL/Plus, but "Show Errors" or "see the err" also returned "No. Errors."

    Any advice would be much appreciated.

    Thank you very much.

    Hello

    Try this

      CREATE OR REPLACE FORCE VIEW  APPS.XX_TEST2
        (
            period_name
          , ytd
          ,  a_num    -- because you select * you need all rows
          ,  d_num
          ,  dif
        )
        AS  ...
    

    concerning
    Kay

  • Create the custom for more than one table, and then another user authentication scheme

    Hello

    I already test to create an courable authentication scheme. It works very well!

    My problem is that I designed a database on the data requirements. So the results are two different user tables - one record data of the company and the other to consist of data from dealers. Both can register on my web application with e-mail address (Unique).

    The authentication scheme in APEX checks the table right on a data user!

    A possible solution is to call the company with the dealer table table. But in the picture of society isn't some attributes wich find no need in the dealer table and vice versa.
    Further, that it is not possible that the concessionaire may register that they self as a company with the same which e-mail they use for registration as a reseller.

    Can you give me some more ideas how slove/manage this problem...

    I am using APEX 4.0.2 on an Oracle 10 g database.

    NEDO

    Edited by: Mr.Nedo the 12.05.2011 02:16

    >
    The authentication scheme in APEX checks the table right on a data user!

    A possible solution is to call the company with the dealer table table. But in the picture of society isn't some attributes wich find no need in the dealer table and vice versa.
    Further, that it is not possible that the concessionaire may register that they self as a company with the same which e-mail they use for registration as a reseller.
    >

    Create a view which combines common elements of the user of the 2 tables and the authentication scheme based checks on the view.

  • View - materialized value too large

    Hello

    I have a table, say X of DB1. When I tried to create a table, materialized in DB2 to DB1 x. I don't get "form of predefined table does not match query definition. But the size of the columns in the source and the pre-build table are the same.
    SQL 9i >>CREATE TABLE jjj
      2  (
      3   DLR_NUM   NUMBER(5)  NOT NULL ,
      4   DLR_NAME  CHAR(56)  NULL);
    
    Table created.
    
    SQL 9i >>CREATE MATERIALIZED VIEW jjj 
      2   ON PREBUILT TABLE 
      3  WITH REDUCED PRECISION
      4  REFRESH COMPLETE
      5    AS  SELECT 
      6   PRIMARY_DLR_NUM AS DLR_NUM,
      7  SUBSTR(PRIMARY_DLR_NAME,1,56) DLR_NAME
      8   FROM syn_src_table  ;
    SUBSTR(PRIMARY_DLR_NAME,1,56) DLR_NAME
    *
    ERROR at line 7:
    ORA-12060: shape of prebuilt table does not match definition query
    
    SQL 9i >>desc syn_src_table ;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
    PRIMARY_DLR_NAME                          NOT NULL CHAR(56 BYTE)
    PRIMARY_DLR_NUM                           NOT NULL NUMBER(5)
    Basically, I am trying to extract the data to a different database using the materialized view. For a particular column, the length of the source table is 56 and I am creating the MView based on this table. Thus the length in the MVIEW is also 56 for this column. But when I try to refresh the Mview I get the error message too large value.

    Why is it abnormal behavior and is there a work around for this.

    Please throw some light on this.

    Thanks in advance,
    Jaggyam

    This could be another multibyte character issue?

    Try:

    SUBSTRB(PRIMARY_DLR_NAME,1,56) DLR_NAME
    
  • What is the Assembly of 4 or 5 tables FULL OUTER JOIN logic?

    the query is as below:

    as you can see, I need FULL OUTER JOIN, these 5 tables and get a column from each table that is based on three common columns (ORG_iD, CUST_ID, CURRENT_DT).

    And I wonder what is the logic of the 5 FULL OUTER JOIN table?
    It will return if there is a folder that exists in the single table COL1? or table, COL2 and COL3 and so on. Basically any combination of these 5 tables.

        SELECT (CASE WHEN COL1.ORG_ID IS NOT NULL THEN COL1.ORG_ID
                     WHEN COL2.ORG_ID IS NOT NULL THEN COL2.ORG_ID
                     WHEN COL3.ORG_ID IS NOT NULL THEN COL3.ORG_ID
                     WHEN COL4.ORG_ID IS NOT NULL THEN COL4.ORG_ID
                     ELSE COL5.ORG_ID 
                END) ORG_ID,
                (CASE WHEN COL1.CUST_ID IS NOT NULL THEN COL1.CUST_ID
                     WHEN COL2.CUST_ID IS NOT NULL THEN COL2.CUST_ID
                     WHEN COL3.CUST_ID IS NOT NULL THEN COL3.CUST_ID
                     WHEN COL4.CUST_ID IS NOT NULL THEN COL4.CUST_ID
                     ELSE COL5.CUST_ID
                END) CUST_ID, 
                (CASE WHEN COL1.CURRENT_DT IS NOT NULL THEN COL1.CURRENT_DT
                     WHEN COL2.CURRENT_DT IS NOT NULL THEN COL2.CURRENT_DT
                     WHEN COL3.CURRENT_DT IS NOT NULL THEN COL3.CURRENT_DT
                     WHEN COL4.CURRENT_DT IS NOT NULL THEN COL4.CURRENT_DT
                     ELSE COL5.CURRENT_DT 
                END) CURRENT_DT, 
              'VENDORS' as ITEM_NAME,
              V_AGE_IND as ACCT_AGE_IND,  
              COL1.AMT_ZSHT,  
              COL2.AMT_YFYS,  
              COL3.AMT_YFYS, 
              COL4.AMT_YFYS,  
              COL5.AMT_BZL,  
              'NAV',
              sysdate
        FROM COL1  
                  FULL OUTER JOIN COL2 ON (COL1.ORG_ID=COL2.ORG_ID AND COL1.CURRENT_DT=COL2.CURRENT_DT AND COL1.CUST_ID=COL2.CUST_ID)  
                  FULL OUTER JOIN COL3 ON (COL2.ORG_ID=COL3.ORG_ID AND COL2.CURRENT_DT=COL3.CURRENT_DT AND COL2.CUST_ID=COL3.CUST_ID)  
                  FULL OUTER JOIN COL4 ON (COL3.ORG_ID=COL4.ORG_ID AND COL3.CURRENT_DT=COL4.CURRENT_DT AND COL3.CUST_ID=COL4.CUST_ID)  
                  FULL OUTER JOIN COL5 ON (COL4.ORG_ID=COL5.ORG_ID AND COL4.CURRENT_DT=COL5.CURRENT_DT AND COL4.CUST_ID=COL5.CUST_ID)  
    Any ideas?

    Thank you

    Hello

    When you perform a JOIN EXTERNAL COMPLETE multi - build that way, whenever you add a new table, you can just join the previous table because this table could be all NULL values for a given row. You can reach each new table to the first table, either, for the same reason. You must enclose each new table with all previous tables, like this:

    FULL OUTER JOIN COL2 ON  COL2.ORG_ID     =           COL1.ORG_ID
                   AND COL2.CURRENT_DT =           COL1.CURRENT_DT
                   AND COL2.CUST_ID    =           COL1.CUST_ID
    FULL OUTER JOIN COL3 ON  COL3.ORG_ID     = COLAESCE (COL1.ORG_ID,     COL2.ORG_ID)
                   AND COL3.CURRENT_DT = COALESCE (COL1.CURRENT_DT, COL2.CURRENT_DT)
                   AND COL3.CUST_ID    = COALESCE (COL1.CUST_ID,    COL2.CUST_ID)
    FULL OUTER JOIN COL3 ON  COL4.ORG_ID     = COLAESCE (COL1.ORG_ID,     COL2.ORG_ID,     COL3.ORG_ID)
                   AND COL4.CURRENT_DT = COALESCE (COL1.CURRENT_DT, COL2.CURRENT_DT, COL3.CURRENT_DT)
                   AND COL4.CUST_ID    = COALESCE (COL1.CUST_ID,    COL2.CUST_ID,    COL3.CUST_ID)
    FULL OUTER JOIN COL3 ON  COL5.ORG_ID     = COLAESCE (COL1.ORG_ID,     COL2.ORG_ID,     COL3.ORG_ID,     COL4.ORG_ID)
                   AND COL5.CURRENT_DT = COALESCE (COL1.CURRENT_DT, COL2.CURRENT_DT, COL3.CURRENT_DT, COL4.CURRENT_DT)
                   AND COL5.CUST_ID    = COALESCE (COL1.CUST_ID,    COL2.CUST_ID,    COL3.CUST_ID,    COL4.CUST_ID)  
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
    Explain how you get these results from these data.
    Always tell what version of Oracle you are using.

  • Create multiple view ingres column definition table

    I start here in this forum because I don't know where this problem is better managed.

    I use an Ingres database using heterogeneous services. I create a view on Ingres in an array of Ingres.
    so I issue a create in select table * view Ingres to create an oracle table in the oracle system.

    It works, but when I look at the definition of the column, they are created with a multiple of 3. for example,.

    varchar (5) will become a varchar2 (15)... when I use enterprise manager to view the oracle table.

    Yes, Ingres has the column as a varchar, then oracle it translates varchar2. I use Oracle Rel 11Rel 2.
    and Ingres is old version 2.0.

    The view created on the side of Ingres is correct... but once I create a table in the view that this column
    definitions of change. BTW... I tried this without notice and oracle continues to increase the size of 3.

    Any ideas as to why this is happening and how to stop it?

    Thank you.




    I did a search on the NLS_parameters... I use AL32UTF8.

    When I'm in SQLPLUS and make a remote table desc...

    / / DESC remote_table@HSLINK > > > > HSLINK is the name of ODBC db link connection.

    I get the fields like ID Varchar2 (45)...

    When I view it at Ingres, using Visual DBA... it's ID Varchar (15)

    Published by: sgonos on July 8, 2010 07:24

    main cause is the Oracle database character set. The Oracle database does not know which character set your foreign database uses. In the worst case scenario it may happen, the character abroad datababase contains unicode data and requires 3 bytes. The gateway works in byte mode and therefore the accuracy of the foreign database is triple.

    At 11.2 most gateways are used to define the parameter HS_KEEP_REMOTE_COLUMN_SIZE, which prevents the precision of the column increase.

  • Create table works, create materialized view only - long column names?

    Hello.

    I have no probs creating a table as well: -.
    CREATE TABLE blah
    (
    DEVICE_ID
    )
    in select
    "Device_ID" AS DEVICE_ID
    "of"sum" Device"@ed_link_3
    where "Device_ID" < 5;


    But when I try to create a materialized view:
    Blah1 CREATE MATERIALIZED VIEW
    (
    DEVICE_ID
    )
    < various materialized view parms >
    in select
    "Device_ID" AS DEVICE_ID
    "of"sum" Device"@ed_link_3
    where "Device_ID" < 5;

    It fails with errors: -.
    ORA-04052: error occurred when searching to the top of the remote object Aggregate.Device@ED_LINK_3
    ORA-01948: length of the name of the identifier (31) exceeds maximum (30)

    Is there a way to get around this?
    Is the problem with the columns of the remote table of device, which I do NOT need to import to have column names that are longer than 30 characters?

    For now, I want only the Device_ID column which is a simple 9 characters long.

    Oh, and the remote database is MySQL.
    I'm uncomfortable with the < parms of materialized view > as they work fine when I choose a different remote table with only short column names.

    Thank you.

    To my knowledge, you have the option
    (a) create view (with shortened column names or only with desired columns if they are already less than 30 char limit) side of mysql
    (b) use dbms_passthrough to force the analysis to be done on mysql (as in the example provided by SY here use dbms_passthrough to create a view )
    However, I prefer to stick to one), because with dbms_passtrhough, you retrieve row by row.

    Best regards

    Maxim

  • Creating a view of mast bearing the same name with the name of the table

    Hello world

    After having dropped the name of view mast QQ. "" TRDLN_DIM_MV ", I try to recreate by having the same name as the table, but I got an error message stating that"the name is already used by an existing object. How to create a matte view to resemble the object possessed by schema 'GQ', with a name identical to the name of the table, drop the table?

    OWNER_O CREATED LAST_DDL_ TIMESTAMP STATUS OBJECT_NAME OBJECT_TYPE
    ===
    GQ MATERIALIZED VIEW 5 NOVEMBER 08 2008 13 DECEMBER 08-11 - 05:06:31:46 TRDLN_DIM_MV VALID
    GQ TABLE 5 NOVEMBER 08 2008 15 DECEMBER 08-11 - 05:06:31:00 TRDLN_DIM_MV VALID
    QQ TABLE 17 AUGUST 07 16 MARCH 09 2007-08 - 17:17:05:21 TRDLN_DIM_MV VALID

    SQL & gt; CREATE THE QQ MATERIALIZED VIEW. TRDLN_DIM_MV
    2 TABLESPACE FPLC01S
    3 NOCACHE
    4 NOLOGGING
    5 PACK
    6 PARALLEL (DEGREE 1 2 INSTANCES)
    7 BUILD IMMEDIATE
    8 REFRESH FORCE ON REQUEST
    9 WITH PRIMARY KEY
    10 AS
    11 Select / * + NO_REWRITE * / trdln_id,.
    trdln_skid 12,
    trdln_end_date 13,
    FIRST_VALUE (trdln_end_date) 14 over (partition by order of trdln_id trdln_end_date DESC) as MaxDate
    15 QQ.trdln_dim;
    of QQ.trdln_dim
    *
    ERROR on line 15:
    ORA-00955: name is already used by an existing object

    I appreciate your help. Thanks in advance!

    Kind regards
    Radic

    You must rename the table (using ALTER TABLE TableName RENAME to othername ;) before creating the MV.
    You cannot have both existing with the same name in the same schema.

    What you see in the scheme of GQ, is that the 'picture' is the underlying table for the materialized view.
    When you do a MY_MV CREATE MATERIALIZED VIEW AS...
    Oracle creates two objects with the same name, we the MY_MV materialized view, and the other being the MY_MV table, which is the physical storage. {Don't forget that a materialized view is a way to get a physical representation of views.}

    In the schema QQ is what you
    a. a real Table
    or
    b. a MV incorrectly deleted, resulting in the underlying Table always presents.

  • Create a trigger instead of update several tables in a view

    Dear everybody

    I am trying to create a trigger that updates instead of to day joined several tables in a view, but I can't get my trigger to work. The create view command was as follows:
    CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC
    AS
    SELECT MAP_INDEX.mi_prinx,
           index_type_id,
           original_map_publication_id,
           original_map_sheet_number_id,
           name_of_feature,
           geog_coordinates_id,
           GEOG_COORDINATES.mi_prinx AS "mi_prinx_polygon",
           GEOG_COORDINATES.geographical_coordinates,
           GEOG_COORDINATES.mapinfo_style_row
     FROM MAP_INDEX
      JOIN GEOG_COORDINATES
       ON geog_coordinates_id=GEOG_COORDINATES.mi_prinx;
    The view above connects a polygon table to the table of function names which means that a polygon appears several times in a view, even though one version of the polygon exists in the base table. This means the direct update of view cannot take place, since 1 polygon can appear multiple times in a view. The two original base tables and their columns names are:
    MAP_INDEX
    ---------
    MI_PRINX
    INDEX_TYPE_ID
    ORIGINAL_MAP_PUBLICATION_ID
    ORIGINAL_MAP_SHEET_NUMBER_ID
    NAME_OF_FEATURE
    MAPINFO_STYLE_ROW
    GEOGRAPHICAL_COORDINATES
    GEOG_COORDINATES_ID
    
    GEOG_COORDINATES
    ----------------
    MI_PRINX
    GEOGRAPHICAL_COORDINATES
    MAPINFO_STYLE_ROW
    Relax, I created was as follows:
    CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC
       INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC
          REFERENCING NEW AS NEW
     FOR EACH ROW
    BEGIN
     UPDATE MAP_INDEX
      SET mi_prinx = :NEW.mi_prinx,
          index_type_id = :NEW.index_type_id,
          original_map_publication_id = :NEW.original_map_publication_id,
          original_map_sheet_number_id = :NEW.original_map_sheet_number_id,
          name_of_feature = :NEW.name_of_feature,
          mapinfo_style_row = :NEW.mapinfo_style_row,
          geographical_coordinates = :NEW.geographical_coordinates,
          geog_coordinates_id = :NEW.geog_coordinates_id
       WHERE geog_coordinates_id = :OLD.geog_coordinates_id;
     UPDATE GEOG_COORDINATES
      SET mi_prinx = :NEW.mi_prinx,
          geographical_coordinates = :NEW.geographical_coordinates,
          mapinfo_style_row = :NEW.mapinfo_style_row
       WHERE mi_prinx = :OLD.mi_prinx;
    END;
    /
    The idea is that when I draw a new polygon in MapInfo and assign him a revised number geog_coordinates_id and the number of mi_prinx_polygon, which are the same, once I have save the view as then it updates the underlying tables. Geographical_coordinates and mapinfo_style_row of map_index table columns are columns with ancient polygon data which while not having currently new data inserted into them, are required for the previous data they contain. These data are currently being added to the geog_coordinates table with other scripts. The idea is that all the data is then read using a view and updates made to the view, triggering instead of relaxing, so data are not duplicated but still visible as if it were.

    When I created first the relaxation above in SQLdeveloper it seems to run constantly. Then my computer crashed, not related to this work, and I lost session because I did not commit it. I was not ready to commit it because I believe that something is wrong.

    I am in the trigger syntax correctly and I go about it in the right way? I want to only update the rows that have changed, that's why I was using: NEWS and: OLD.

    Kind regards

    Tim

    Published by: user467357 on November 18, 2008 18:07
    I modified my script a little because there were a few errors. for example. start and old as old and view name typo

    Something like this->

    satyaki>
    satyaki>select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    
    Elapsed: 00:00:01.78
    satyaki>
    satyaki>
    satyaki>create table MAP_INDEX
      2   (
      3        mi_prinx                    NUMBER(10) not null,
      4        index_type_id                NUMBER(6) not null,
      5        original_map_publication_id  NUMBER(6) not null,
      6        original_map_sheet_number_id NUMBER(6) not null,
      7        name_of_feature              VARCHAR2(80) not null,
      8        mapinfo_style_row            VARCHAR2(80),
      9        geographical_coordinates    SDO_GEOMETRY,
     10        geog_coordinates_id          NUMBER(10),
     11        constraints pk_mi_prinx primary key(mi_prinx)
     12   );
    
    Table created.
    
    Elapsed: 00:00:04.39
    satyaki>
    satyaki>create table GEOG_COORINDATES
      2   (
      3     mi_prinx NUMBER(10) not null,
      4     geographical_coordinates SDO_GEOMETRY,
      5     mapinfo_style_row VARCHAR2(80),
      6     constraints pk_mi_prinx_n primary key(mi_prinx)
      7   );
    
    Table created.
    
    Elapsed: 00:00:00.30
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC
      2  AS
      3  SELECT MAP_INDEX.mi_prinx,
      4         MAP_INDEX.index_type_id,
      5         MAP_INDEX.original_map_publication_id,
      6         MAP_INDEX.original_map_sheet_number_id,
      7         MAP_INDEX.name_of_feature,
      8         MAP_INDEX.geog_coordinates_id,
      9         GEOG_COORINDATES.mi_prinx AS "mi_prinx_polygon",
     10         GEOG_COORINDATES.geographical_coordinates,
     11         GEOG_COORINDATES.mapinfo_style_row
     12   FROM MAP_INDEX , GEOG_COORINDATES
     13   WHERE MAP_INDEX.geog_coordinates_id=GEOG_COORINDATES.mi_prinx;
    
    View created.
    
    Elapsed: 00:00:00.32
    satyaki>
    satyaki>
    satyaki>insert into MAP_INDEX values(
      2                                 &mi_prinx,
      3                                 &index_type_id,
      4                                 &original_map_publication_id,
      5                                 &original_map_sheet_number_id,
      6                                 '&name_of_feature',
      7                                 '&mapinfo_style_row',
      8                                 null,
      9                                 &geog_coordinates_id);
    Enter value for mi_prinx: 1
    old   2:                                &mi_prinx,
    new   2:                                1,
    Enter value for index_type_id: 44
    old   3:                                &index_type_id,
    new   3:                                44,
    Enter value for original_map_publication_id: 5678
    old   4:                                &original_map_publication_id,
    new   4:                                5678,
    Enter value for original_map_sheet_number_id: 356
    old   5:                                &original_map_sheet_number_id,
    new   5:                                356,
    Enter value for name_of_feature: AA
    old   6:                                '&name_of_feature',
    new   6:                                'AA',
    Enter value for mapinfo_style_row: GG
    old   7:                                '&mapinfo_style_row',
    new   7:                                'GG',
    Enter value for geog_coordinates_id: 9
    old   9:                                &geog_coordinates_id)
    new   9:                                9)
    
    1 row created.
    
    Elapsed: 00:00:00.16
    satyaki>/
    Enter value for mi_prinx: 2
    old   2:                                &mi_prinx,
    new   2:                                2,
    Enter value for index_type_id: 55
    old   3:                                &index_type_id,
    new   3:                                55,
    Enter value for original_map_publication_id: 6789
    old   4:                                &original_map_publication_id,
    new   4:                                6789,
    Enter value for original_map_sheet_number_id: 357
    old   5:                                &original_map_sheet_number_id,
    new   5:                                357,
    Enter value for name_of_feature: BB
    old   6:                                '&name_of_feature',
    new   6:                                'BB',
    Enter value for mapinfo_style_row: 10
    old   7:                                '&mapinfo_style_row',
    new   7:                                '10',
    Enter value for geog_coordinates_id: 8
    old   9:                                &geog_coordinates_id)
    new   9:                                8)
    
    1 row created.
    
    Elapsed: 00:00:00.04
    satyaki>
    satyaki>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>
    satyaki>insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row');
    Enter value for mi_prinx: 9
    Enter value for mapinfo_style_row: FFG
    old   1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row')
    new   1: insert into GEOG_COORINDATES values(9,null,'FFG')
    
    1 row created.
    
    Elapsed: 00:00:00.07
    satyaki>/
    Enter value for mi_prinx: 8
    Enter value for mapinfo_style_row: GGT
    old   1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row')
    new   1: insert into GEOG_COORINDATES values(8,null,'GGT')
    
    1 row created.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 AA                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC
      2  INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC
      3  FOR EACH ROW
      4  DECLARE
      5   m_info_svw  varchar2(80);
      6  BEGIN
      7   m_info_svw :=  :NEW.mapinfo_style_row;
      8
      9   UPDATE MAP_INDEX
     10    SET mi_prinx = :NEW.mi_prinx,
     11        index_type_id = :NEW.index_type_id,
     12        original_map_publication_id = :NEW.original_map_publication_id,
     13        original_map_sheet_number_id = :NEW.original_map_sheet_number_id,
     14        name_of_feature = :NEW.name_of_feature,
     15        mapinfo_style_row = m_info_svw,
     16        geographical_coordinates = :NEW.geographical_coordinates,
     17        geog_coordinates_id = :NEW.geog_coordinates_id
     18     WHERE geog_coordinates_id = :OLD.geog_coordinates_id;
     19   UPDATE GEOG_COORINDATES
     20    SET mi_prinx = :NEW.geog_coordinates_id,
     21        geographical_coordinates = :NEW.geographical_coordinates,
     22        mapinfo_style_row = m_info_svw
     23     WHERE mi_prinx = :OLD.geog_coordinates_id;
     24  END;
     25  /
    
    Trigger created.
    
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 CC                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 FFG
             8 GGT
    
    Elapsed: 00:00:00.07
    satyaki>select * from MAP_INDEX;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  MAPINFO_STYLE_ROW                                                                GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------
             1            44                        5678                          356 CC                                                                               HHH
             2            55                        6789                          357 BB                                                                               HHH                                                                                                                                                  
    
    Elapsed: 00:00:00.12
    satyaki>
    satyaki>update VIEW_MI_JOIN_GC
      2    set name_of_feature = 'DD'
      3  where mi_prinx = 1;
    
    1 row updated.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 DD                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.08
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 FFG
             8 GGT
    
    Elapsed: 00:00:00.06
    satyaki>
    satyaki>update VIEW_MI_JOIN_GC
      2     set mapinfo_style_row = 'OOOO'
      3     where mi_prinx = 1;
    
    1 row updated.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 OOOO
             8 GGT
    
    Elapsed: 00:00:00.06
    satyaki>
    satyaki>select mapinfo_style_row from MAP_INDEX;
    
    MAPINFO_STYLE_ROW
    --------------------------------------------------------------------------------
    OOOO
    HHH
    
    Elapsed: 00:00:00.06
    satyaki>
    

    Hope this will help you.

    Kind regards.

    LOULOU.

  • Create a view of RDF in Oracle 12 c of tables in an Oracle 11 g Server

    Hello!

    I have a relational database in Oracle 11 g server, but I need to create the view of RDF model in Oracle 12 c in the base tables.

    I created a database connection to connect to the server of Oracle 11 g Oracle 12 c, using the statement:

    CREATE DATABASE LINK myDBLink

    CONNECT to user_test

    IDENTIFIED BY test123

    WITH THE HELP OF '(DESCRIPTION=)

    (ADDRESS = (PROTOCOL = TCP)(HOST=192.0.56.158) (PORT = 1521))

    (CONNECT_DATA = (SID = orcl)))';

    The works of the SELECT statement:

    Select * from EMP@myDBLink;

    I also created a SYNONYM:

    CREATE the SYNONYM MY_EMP FOR EMP@myDBLink;

    The SELECT statement with the synonym also works:

    Select * from EMP@MY_EMP;

    Well, to create the view of RDF, I use a sem_apis.create_rdfview_model function. Now, I wrote the statement of the following two ways:

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List ('MY_EMP', 'MY_DEPT'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List('EMP@myDBLink','DEPT@myDBLink'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    And I get the following error:

    ORA-13199: fetchTabIDList: not found in tables:

    ORA-06512: at the 'MDSYS. SDO_RDF_INTERNAL', line 14308

    ORA-06512: at the 'MDSYS. SDO_RDF', line 3616

    ORA-06512: at the 'MDSYS. RDF_APIS', line 1253

    ORA-06512: at line 2


    I use examples of book of the Oracle tables.


    Thank you


    Yenier

    Yenier,

    Could you please try creating a view rather than a synonym? Here is an example:

    SQL >-create dblink

    SQL > create public database link

    2 mylink

    3 connect to

    Scott 4

    5 identified by

    6 Tiger

    using a 7 ':/';

    Database link created.

    SQL >

    SQL >-create view local using queries involving remote database objects

    SQL > create view dblink_scott_EMP in select * from EMP@mylink;

    Created view.

    SQL >

    SQL >-add the primary key (help requests on Direct mapping according to models RDFView to have shorter SubjectMaps)

    SQL > alter view dblink_scott_EMP add constraint pk_EMPNO primary key (EMPNO) disable;

    Altered view.

    SQL >

    SQL > - create model DM - based RDFview

    SQL > exec sem_apis.create_rdfview_model ('dblink_test_rv', sys.odcivarchar2list ('DBLINK_SCOTT_EMP'), "http://dm/");

    PL/SQL procedure successfully completed.

    SQL >

    Thank you

    -Smiled.

  • Create a view using the table

    Hi all

    I am beginner in Oracle.

    I have a two-column table that I use to create a view documents/statement once it meets the qualification.

    The table has fields. 1 number and 2. Group. If there is more than 3 records found on this table with the same NUMBER and the GROUP he should create this table view.

    Thank you

    Pramod Devkate

    The training is therefore two lines for a ticket and the agent. When the third row is added, create a line in the summary table. Later a fourth line is added to the table of training for this ticket and the agent, but we do not update the line in the summary table. We only touch the summary table when the third row is added to the training table, then it is only updated by the application. Very well

    INSERT INTO summary (ticket, agent, total_travel, total_mtts)

    Select ticket agent, sum (travel), sum (mtts)

    training

    where (ticket, agent) not in

    (select the ticket agent summary)

    Group ticket, agent

    having count (*) > 2.

    This inserts in the table only notes and agent ID that do not exist already.

  • We can create a view or table with a form button?

    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Gul says:
    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Yes. You can. Use the FORMS_DDL built-in. For example

    BEGIN
      Forms_DDL('create table temp(n NUMBER)');
      IF NOT FORM_SUCCESS THEN
        Message ('Table Creation Failed');
      ELSE
        Message ('Table Created');
      END IF;
    END; 
    

    Hope this helps

    Hamid

  • create materialized view log on the table without a primary key

    Hi all
    CREATE TABLE client_months 
    (
      SUBJ_CODE         NUMBER(4),
      SERV_CODE         NUMBER(4),
      DEBIT_CODE        NUMBER(4),
      PERIOD_NUM        NUMBER(2),
      PERIOD_NAME       VARCHAR2(40 CHAR),
      FIRST_MON_DAY     DATE,
      LAST_MON_DAY      DATE,
      VALUE_MON_DAY     DATE,
      MONTHES           NUMBER(4,2),
      GARDENING_WEIGHT  NUMBER(5,4),
      REASON_CODE       NUMBER(5),
      STAMP_ACTION      VARCHAR2(1 CHAR),
      STAMP_CDATE       DATE                        DEFAULT SYSDATE,
      STAMP_DATE        DATE,
      STAMP_USER        VARCHAR2(15 CHAR),
      REGION_CODE       NUMBER(9)
    )
    table created.
    
    CREATE UNIQUE INDEX client_months_UK  ON client_months 
    (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
    index created.
    
    CREATE MATERIALIZED VIEW LOG ON client_months with rowid;
    
    CREATE MATERIALIZED VIEW client_months_mv 
    BUILD immediate 
    REFRESH FAST ON COMMIT 
    AS 
    SELECT * FROM client_months;
    
    ORA-12014: table 'CLIENT_MONTHS' does not contain a primary key constraint
    I don't want to refresh the mview when validation is performed on the base table.
    And I don't want to change the base table by adding a primary key.

    is it possible to create the mview journal using the unique index? or another solution?
    Please help
    Thanks in advance
    Naama

    Naamas wrote:
    No,
    I already read this post!

    Then you read wrong:

    SQL> CREATE TABLE client_months
      2  (
      3    SUBJ_CODE         NUMBER(4),
      4    SERV_CODE         NUMBER(4),
      5    DEBIT_CODE        NUMBER(4),
      6    PERIOD_NUM        NUMBER(2),
      7    PERIOD_NAME       VARCHAR2(40 CHAR),
      8    FIRST_MON_DAY     DATE,
      9    LAST_MON_DAY      DATE,
     10    VALUE_MON_DAY     DATE,
     11    MONTHES           NUMBER(4,2),
     12    GARDENING_WEIGHT  NUMBER(5,4),
     13    REASON_CODE       NUMBER(5),
     14    STAMP_ACTION      VARCHAR2(1 CHAR),
     15    STAMP_CDATE       DATE                        DEFAULT SYSDATE,
     16    STAMP_DATE        DATE,
     17    STAMP_USER        VARCHAR2(15 CHAR),
     18    REGION_CODE       NUMBER(9)
     19  )
     20  /
    
    Table created.
    
    SQL> CREATE UNIQUE INDEX client_months_UK  ON client_months
      2  (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
      3  /
    
    Index created.
    
    SQL> CREATE MATERIALIZED VIEW LOG ON client_months with rowid
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW client_months_mv
      2  BUILD immediate
      3  REFRESH FAST WITH ROWID ON COMMIT -- pay attention to WITH ROWID
      4  AS
      5  SELECT * FROM client_months
      6  /
    
    Materialized view created.
    
    SQL>
    

    SY.

Maybe you are looking for