Display columns as rows from non-unique key table

Hi OTN/Users, I hope you can assist me
Given a table:
create table t (a varchar2(30), b int, c date );
with this data within:
insert into t values ( a1, 40, to_date( '01-Dec-2012'));
insert into t values ( a1, 50, to_date( '01-Dec-2012'));
insert into t values ( a1, 60, to_date( '01-Dec-2012'));
insert into t values ( b1, 10, to_date( '01-Dec-2012'));
insert into t values ( b1, 20, to_date( '01-Dec-2012'));
insert into t values ( b1, 30, to_date( '01-Dec-2012'));
insert into t values ( c1, 60, to_date( '01-Dec-2012'));
insert into t values ( c1, 70, to_date( '01-Dec-2012'));
insert into t values ( c1, 80, to_date( '01-Dec-2012'));
- I want to output the columns for each of 'a' as a single row e.g:
a1 40 50 60 01-Dec-2012
b1 10 20 30 01-Dec-2012
I've almost got it right, but the 'a' col repeats 4 times for each row of output:
a1 40
a1 50
a1 60
a1 01-Dec-2012
-I want to supress repeat output of the first column 'a' but display the rest in a straight line.
I've tried various things (Pivot, Rollup etc), but the fact i'm keying on a table with non unique rows has complicated things perhaps.
Any help would be much appreciated

Hi,
Pre-11g this is how you would do it :[11.2] Pri @ Bepripd1 > !cat t.sql
with t(a,b,c) as (
     select  'a1', 40, to_date( '01-Dec-2012') from dual union all
     select  'a1', 50, to_date( '01-Dec-2012') from dual union all
     select  'a1', 60, to_date( '01-Dec-2012') from dual union all
     select  'b1', 10, to_date( '01-Dec-2012') from dual union all
     select  'b1', 20, to_date( '01-Dec-2012') from dual union all
     select  'b1', 30, to_date( '01-Dec-2012') from dual union all
     select  'c1', 60, to_date( '01-Dec-2012') from dual union all
     select  'c1', 70, to_date( '01-Dec-2012') from dual union all
     select  'c1', 80, to_date( '01-Dec-2012') from dual
------ end of sample data ------
select
     a
     ,max(decode(n,1,b,null)) q1
     ,max(decode(n,2,b,null)) q2
     ,max(decode(n,3,b,null)) q3
     ,c
from (
     select a, b, c, row_number() over (partition by a order by b) n
     from t
group by a,c
order by a,c
[11.2] Pri @ Bepripd1 > @t
A          Q1         Q2         Q3 C
a1         40         50         60 01/12/2012 00:00:00
b1         10         20         30 01/12/2012 00:00:00
c1         60         70         80 01/12/2012 00:00:00------
From 11g onward, you would :[11.2] Pri @ Bepripd1 > !cat t.sql
with t(a,b,c) as (
     select  'a1', 40, to_date( '01-Dec-2012') from dual union all
     select  'a1', 50, to_date( '01-Dec-2012') from dual union all
     select  'a1', 60, to_date( '01-Dec-2012') from dual union all
     select  'b1', 10, to_date( '01-Dec-2012') from dual union all
     select  'b1', 20, to_date( '01-Dec-2012') from dual union all
     select  'b1', 30, to_date( '01-Dec-2012') from dual union all
     select  'c1', 60, to_date( '01-Dec-2012') from dual union all
     select  'c1', 70, to_date( '01-Dec-2012') from dual union all
     select  'c1', 80, to_date( '01-Dec-2012') from dual
------ end of sample data ------
select a,q1,q2,q3,c
from (
     select a, b, c, row_number() over (partition by a order by b) n
     from t
pivot (
     max(b)
     for n in (
          1 as q1
          ,2 as q2
          ,3 as q3
order by a,c
[11.2] Pri @ Bepripd1 > @t
A          Q1         Q2         Q3 C
a1         40         50         60 01/12/2012 00:00:00
b1         10         20         30 01/12/2012 00:00:00
c1         60         70         80 01/12/2012 00:00:00Edited by: Nicosa on Nov 9, 2012 2:42 PM

Similar Messages

  • Java OracleXML putXML & non-unique keys

    I am using the XML SQL Utility for java on the client (NT) to insert multi-row XML documents into an ORACLE table. Everything works fine until I hit a row with a non-unique key. It appears insertXML throws an error and the insert stops at that point. Rows after the non-unique key row are not processed.
    Is there any way to process all rows of an XML document, telling me how many read, how many inserted, how many not processed??
    Also, what about update capabilities? Presently I am not needing to update from XML into ORACLE, all I can do now is insert.
    Thanks in advance,
    Rick

    One way to make this work would be to take advantage of Oracle8i's INSTEAD OF triggers on views.
    Basically, you would:
    (1) CREATE VIEW someview
    AS SELECT * FROM sometable;
    (2) CREATE TRIGGER someview_trig
    INSTEAD OF INSERT ON someview
    DECLARE
    BEGIN
    -- Check for existence of
    -- row using the value of
    -- :NEW.pk_column_name
    IF (you-found-an-existing-one) THEN
    -- Do something here like
    -- NULL; to ignore the insert altogether
    -- or possible an INSERT into
    -- and EXCEPTIONS table...
    ELSE
    INSERT INTO sometable
    VALUES (:NEW.column1, ..., :NEW.columnn);
    END IF;
    END;
    (3) Then point XML SQL Utility at someview
    instead of sometable
    and you'll be in business, as they say.

  • One row as editable and other row as non-editable in table control

    Hi Experts,
               Is this possible to make one row as editable and another row is non editable in table control?
    My Requirement is
    1st row non editable field
    Customer code, description,amount will come from the previous screen this will be non editable for user.
    2nd row editable
    User has to enter the amount in 2nd row here the customer code description will be empty.
    If 4 customer are there
    1,3,5,7 should be non editable and 2,4,6,8 should be editable..
    Pls help me in this issue..
    Thanks in Advance!

    hI
    This is a simple Module POOL program with only Table control and nothing else
    " This is Tested to Enable one row and disabling the next row
    in TOP Include
    controls : tc type tableview using screen 100.
    DATA : OK TYPE SY-UCOMM.
    DATA : ITAB TYPE TABLE OF SPFLI WITH HEADER LINE.
    in PBO
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      LOOP AT itab WITH CONTROL tc.
       MODULE TC_MOD.
      ENDLOOP.
    in PAI
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
      LOOP AT itab.
      ENDLOOP.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'TEST'.
      SET TITLEBAR 'TEST'.
      DESCRIBE TABLE itab LINES tc-lines.
      IF tc-lines = 0.
        tc-lines = 20.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE tc_mod OUTPUT.
      DATA : mod TYPE i.
      LOOP AT SCREEN.
        mod =  tc-CURRENT_LINE MOD 2  .
        IF mod = 1.
          IF screen-name = 'SPFLI-CARRID'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " TC_MOD  OUTPUT
    Edited by: Ramchander Krishnamraju on Jan 25, 2011 7:17 AM

  • Generic function to display a specific row from any table

    Hi all,
    I need some help to write a function in PL/SQL or Dynamic SQL (or both), to write a function that would take in parameters only the unique ID of the row to display and the name of the table to display (that could be any table with any format).
    Actually we don't know in advance which table will be accessed, so we don't know the columns and their types until the function is called.
    Once I get the row, I want to return a small table with a size of only one line containing the details of the row I looked for.
    So the signature of the function would be something like: CREATE function displayDetailedRowFromAnyTable(uniqId in varchar2(25), tableName in varchar2(25)).
    Hope the description is clear. I found in some forums some details about this kind of problems; however, the structure of the tables (ie. the columns name and their types) is always known in advance. In my case, I don't know those details until run time.
    Any help would be greatly appreciated.

    There is a built in "function" to do this. It's called "SELECT" and it's available through the SQL engine. You give it the table name and the ID you want and it can return you all the columns from that table...
    e.g.
    SELECT *
    FROM <table_name>
    WHERE id = <required_id>If you truly want a generic dynamic SQL then you'll have to code it as an ANYTYPE (as already mentioned above). Although this will make your code very complex and difficult to maintain.
    e.g. of defining your own dynamic pipelined function using anytype ...
    create or replace type NColPipe as object
      l_parm varchar2(10),   -- The parameter given to the table function
      rows_requested number, -- The parameter given to the table function
      ret_type anytype,      -- The return type of the table function
      rows_returned number,  -- The number of rows currently returned by the table function
      static function ODCITableDescribe( rtype out anytype, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      static function ODCITablePrepare( sctx out NColPipe, ti in sys.ODCITabFuncInfo, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      static function ODCITableStart( sctx in out NColPipe, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      member function ODCITableFetch( self in out NColPipe, nrows in number, outset out anydataset )
      return number,
      member function ODCITableClose( self in NColPipe )
      return number,
      static function show( p_parm in varchar2, p_rows_req in number := 1 )
      return anydataset pipelined using NColPipe
    create or replace type body NColPipe as
      static function ODCITableDescribe( rtype out anytype, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
        atyp anytype;
      begin
        anytype.begincreate( dbms_types.typecode_object, atyp );
        atyp.addattr( to_char(to_date(p_parm,'MONYYYY'),'MONYY')
                    , dbms_types.typecode_varchar2
                    , null
                    , null
                    , 10
                    , null
                    , null
        atyp.endcreate;
        anytype.begincreate( dbms_types.typecode_table, rtype );
        rtype.SetInfo( null, null, null, null, null, atyp, dbms_types.typecode_object, 0 );
        rtype.endcreate();
        return odciconst.success;
      exception
        when others then
          return odciconst.error;
      end;  
      static function ODCITablePrepare( sctx out NColPipe, ti in sys.ODCITabFuncInfo, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
        elem_typ sys.anytype;
        prec pls_integer;
        scale pls_integer;
        len pls_integer;
        csid pls_integer;
        csfrm pls_integer;
        tc pls_integer;
        aname varchar2(30);
      begin
        tc := ti.RetType.GetAttrElemInfo( 1, prec, scale, len, csid, csfrm, elem_typ, aname );
        sctx := NColPipe( p_parm, p_rows_req, elem_typ, 0 );
        return odciconst.success;
      end;
      static function ODCITableStart( sctx in out NColPipe, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
      begin
        return odciconst.success;
      end;
      member function ODCITableFetch( self in out NColPipe, nrows in number, outset out anydataset )
      return number
      is
      begin
        anydataset.begincreate( dbms_types.typecode_object, self.ret_type, outset );
        for i in self.rows_returned + 1 .. self.rows_requested
        loop
          outset.addinstance;
          outset.piecewise();
          outset.setvarchar2( self.l_parm );
          self.rows_returned := self.rows_returned + 1;
        end loop;
        outset.endcreate;
        return odciconst.success;
      end;
      member function ODCITableClose( self in NColPipe )
      return number
      is
      begin
        return odciconst.success;
      end;
    end;
    And to use it
    SQL> select * from table( NColPipe.show( 'JAN2008' ) );
    JAN08
    JAN2008

  • Delete a Row from a Nested Data Table

    Hi... Good day...
    I have a dataTable nested within another DataTable.
    I want to delete a Row from the nested DataTable on clicking a remove Button at the Last column of the Nested DataTable, Jus in the browser.
    How to accomplish this using JavaScript?
    Here is my Code Snippet..
    <h:dataTable value="#{myListBean.rpts}" binding="#{myListBean.parent}" var="item" headerClass ="header" rowClasses = "whiteRow,grayRow" cellspacing="0" cellpadding="4" border = "0"  id = "dataTable">
    <h:column>
         <h:graphicImage id="expand" value="static/images/plus.gif" onclick="showNested(this);" rendered="#{item.schedImgurl=='static/images/scheduled.gif'}"/>
          <div id="#{item.rptId}">
          <h:dataTable id="orderLines" binding="#{myListBean.child}"  value="#{item.scheduleList}" var="schedItem" style="display: none;">
          <h:column>
           <h:outputText value="#{schedItem.scheduleID}" style="display:none;" />
             <f:facet name="header" >
                   <h:outputText value="Scheduled Criteria"/>
              </f:facet>
             <h:outputText value="#{schedItem.scheduleCriteriaName}" />
             <span onMouseOver="JavaScript:showScheduleTooltip(event,'#{schedItem.toolTipCriteraia}')" onMouseOut="JavaScript:hideTooltip()">...</span>
          </h:column>
            <h:column>
           <f:facet name="header" >
          <h:outputText value="Frequency"/>
          </f:facet>
           <h:outputText value="#{schedItem.scheduleFrequency}" />
          </h:column>
          <h:column>
           <f:facet name="header" >
           <h:outputText value="On"/>
           </f:facet>
           <h:outputText value="#{schedItem.scheduleStartDate}" />
          </h:column>
          <h:column>
            <input type="button" value="Remove"onclick=" Remove();"/>
          </h:column>
    </h:dataTable>
    </div>
    </h:column>
    </h:dataTable>Whatz that I need to do inside the Remove() JavaScript Function ?

    Ram_J2EE_JSF wrote:
    How to accomplish this using JavaScript?Using Javascript? Well, you know, Javascript runs at the client side and intercepts on the HTML DOM tree only. The JSF code is completely irrelevant. Open your JSF page in your favourite webbrowser and view the generated HTML source. Finally just base your Javascript function on it.

  • SQL - Retriving Last 6 rows from Join of 2 Tables

    Hi All
    I want to retrive the last 6 rows from a query which has join of 2 tables
    Thanks in adv.
    Junu

    Hi,
    Check this.
    SELECT e.empno, e.deptno, e.sal,e.rn
    FROM (
         SELECT ROWNUM rn, a.empno, b. deptno, a.sal,
              ( SELECT COUNT(1) FROM scott.emp c, scott.dept d
                        WHERE c.deptno = d.deptno ) max_rn
    FROM scott.emp a, scott.dept b
              WHERE a.deptno = b.deptno
         ) e
    WHERE rn BETWEEN max_rn -6 AND max_rn     
    ORDER BY rn     
    Regards
    K.Rajkumar

  • How can I display a specified row from a chart in a 2nd chart in Numbers?

    I have a chart in Numbers '09, which contains tasks with their due dates. This chart is rather large and is divided into several categories (i.e. home, work, taxes, etc.). Each row in the chart has a task name and due date in addition to other information in columns. Since it has many tasks and they are divided into categories, it's difficult to check what tasks are due this week. I have been trying to add a small chart to display only the task name and due date from all categories due in the next 10 days.
    I assume I should add a chart in the work sheet and use some string of functions to find tasks due this week, and copy them to the 2nd chart. If someone could suggest a string of functions, or tell me an easier way to do this I would be grateful.
    Jim

    Hi Jim,
    Welcome to Apple Discussions and the Numbers '09 forum.
    Using the correct vocabulary would make your request much easier to read. A "chart" in Numbers is a bar graph, a line graph, or a pie chart.
    What you're referring to as a "chart" is a "table."
    So:
    You have a table listing tasks and their due dates, plus other information (presumably all separate columns).
    You want a separate table listing only those tasks whose due date falls within the next ten days.
    Here are two ways to make those tasks stand out. The first uses conditional formatting to change the fill colour of the Date cells on the first table; the second uses an index and VLOOKUP to transfer the urgent tasks to a second table.
    The conditional formatting rules shown are applied to all cells in column A. Dates within 5 days of "today" (January 13, 2011 in the example) get a red fill and white type; dates within 10 days a yellow fill.
    The same rules, with effective periods reduced to 2 and 4 days, are applied to dates in the Urgent table below.
    Here a column is added to the left of what was column A to hold an index created by the formula below, entered into the new cell A2 and filled down to the bottom of that column. As noted in the header cell, this column may be hidden.
    =IFERROR(IF(DATEDIF(TODAY(),B,"D")<11,DATEDIF(TODAY(),B,"D")+ROW()/10000,66000), 66000)
    The formula provides a unique numerical value in each row where the date is less than 11 days from today, and a large fixed value in rows where the date is before today or more than 10 days away.
    On the second table, "Urgent" the formula below, entered in A2 and filled down the full column and right to column B transfers the dates and tasks due within ten days from the table "All tasks" in order of 'days to complete,' with the earliest ones at the top of the list.
    =IF(SMALL(All tasks :: $A,ROW()-1)<66000,VLOOKUP(SMALL(All tasks :: $A,ROW()-1),All tasks :: $A$2:$C$21,COLUMN()+1,FALSE),"")
    Descriptions of all the functions used, including examples, may be found in the iWork Formulas and Functions User Guide. Details on Conditional formatting may be found in the Numbers '09 User Guide. Both guides may be downloaded through the Help menu in Numbers '09. Both are recommended.
    Regards,
    Barry

  • ALV display column and row wise

    hi experts,
    Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
    e.g.display format.
                   PO Type          Shipping Date          Invoice Num          PCS  #        Po No.          Cust Name          Terms          Open Balance
    Current                                                                           
    Total Current                                                                           
    1 - 15                                                                           
    Total 1 - 15                                                                           
    16-30                                                                           
    Total 16-30                                                                           
    31 - 60                                                                           
    Total 31 - 60                                                                           
    61 - 90                                                                           
    Total 61 - 90                                                                           
    > 90                                                                           
    Total > 90                                                                           
    TOTAL

    hi Lakshman,
    i want report for customer open invoices that is aging report,
    so depens on due days as per ranges shown in my question like 1--15 days,
    15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
    please send me any proper solution.
    Thanks and Regards,
    Yogesh

  • Display column as row

    Hello Gurus,
    I have a calculated column which actually calculates the average of all the values in 1 category (refer to the example below). So, it actually shows the same average for all the column in that category, which is correct. My problem is I want to show that column as a row so that the average can be shown just once (very similar to grand total)
    EX: This is how it is displayed now
    Category product Sales(in millions) Avg Sales(in millions)
    Category1 TV 12.3 3.5
    Category2 TV 2.3 3.5
    Category3 TV 1.5 3.5
    Categoryn TV 6.3 3.5
    This is how I want to display it as
    Category product Sales(in millions)
    Category1 TV *12.3*
    Category2 TV *2.3*
    Category3 TV *1.5*
    Categoryn TV *6.3*
    Avg Sales (in millions) *3.5*
    Please help!!!
    For some reason, OTN isn't showing correct alignment...
    Avg Sales (in millions) should come under Category and its value 3.5 should come under Sales (in millions)
    Please let me know if I should make it clearer.
    Edited by: Programmer Analyst on May 1, 2013 8:18 AM

    This is what I did with reference to your previous comment (which is helpful), I created a column in criteria for average, with my calculation (i.e.,) avg(sales by category) and in table view, I clicked on SUM icon on category to get the desired result, this is exactly how I wanted except that, it also show the calculated column that I created which I dont want.
    I tried moving that to excluded or hiding it..and both give the same result which is, it doesnt show the average after each category (which is ofcourse makes sense).
    Now, can you help me with getting rid of that column in the report but still show the average for each category.

  • E-mail Body Displays Only 1 Row From Select

    Because APEX doesn't currently (easily) support attachments to e-mail, I've created a process to call the apex_mail.send procedure that then displays specific criteria in the body of the e-mail. This is gathered via a cursor, etc. The problem is, my query only returns 1 row and should return more. I know this because the select for the cursor is essentially the same criteria as I'm using for a report.
    My process is listed below.
    declare
    e_body_html CLOB;
    j_sql CLOB;
    cursor gather_usrs_cur
    is
    select Q_APEX_ID,
    USER_ID,
    Q_USER_TYPE,
    Q_FIRST,
    Q_LAST,
    C_PHONE,
    C_EMAIL,
    C_STATE
    from Q_AUDIT
    where MATCH = 'Y' and
    UPDT_ID is null and
    UPDT_TS is null and
    COMMENTS is null and
    Q_USER_TYPE = :P32_USER_TYPE;
    BEGIN
    e_body_html := 'This e-mail is being generated to inform you that there are users in your State who have had their BLANK access revoked,'||utl_tcp.crlf;
    e_body_html := e_body_html ||' but their access to the secured portions of BLANK is still active. Those users are: '||utl_tcp.crlf||utl_tcp.crlf;
    for usr_rec in gather_usrs_cur
    loop
    begin
    j_sql := usr_rec.user_id||' '||usr_rec.Q_first||' '||usr_rec.Q_last||' '||usr_rec.C_phone||' '||usr_rec.C_email||utl_tcp.crlf;
    j_sql := j_sql ||usr_rec.user_id||' '||usr_rec.Q_first||' '||usr_rec.Q_last||' '||usr_rec.C_phone||' '||usr_rec.C_email||utl_tcp.crlf;
    end;
    end loop;
    commit;
    apex_mail.send(
    P_TO => '[email protected]',
    P_FROM => '[email protected]',
    P_BODY => e_body_html||j_sql,
    P_SUBJ => 'Accounts Requiring Review');
    end;
    I've included the carriage returns and have also tried substituting the ||utl_tcp.crlf|| with ||char(13)|| and ||char(10)||, to no avail. The e-mail displays the body and one row of the select. Please let me know how I can get my entire results list to display. Thanks in advance for your response(s) and expertise.

    Jason,
    The for loop reset the j_sql in every iteration. It should be:
    j_sql := null;
    for usr_rec in gather_usrs_cur
    loop
    begin
    j_sql := j_sql||usr_rec.user_id||' '||usr_rec.Q_first||' '||usr_rec.Q_last||' '||usr_rec.C_phone||' '||usr_rec.C_email||utl_tcp.crlf;
    j_sql := j_sql ||usr_rec.user_id||' '||usr_rec.Q_first||' '||usr_rec.Q_last||' '||usr_rec.C_phone||' '||usr_rec.C_email||utl_tcp.crlf;
    end;
    end loop;Sima

  • How do I lock columns or rows from change

    I want to keep a couple of columns from changing.
    This is to prevent inadvertent changes in passwords or user Id.
    How do i do that.

    Waterdoc,
    Numbers allows you to lock a whole table but individual cells.  This means that it is best to design, upfront, your data so that user input data is in one table and calculations are in other tables (which you can lock).  There is no facility for login access by user.  There is the ability to lock a document using the document inspector:
    See the last section.  This is single password for the whole document.
    You can post suggestions to Apple directly using the menu item "Numbers > Provide Numbers Feedback"
    Best regards,
    Wayne

  • Problem related to display column's full length as default in table control

    Hi Experts,
    I have a screen in report program. In that a table control has been designed.
    Now the issue is that when report program has been executed and the table control screen is called on a particular action then the table columns full length is not visible as default however when i checked the screen layout the default and visible length of colum header and column field is as per required.
    For example  - We have a Period field with default length as 6 and visible length as 15. Its column header is Period with both default length as 15 and visible length as 15.
    The period field has an internal table field reference and its format is NUMC.
    While column header Period is Text field created of type CHAR.
    Please suggest. Any help or inputs will be highly appreciated.
    Thanks,
    Akash

    Hi
    set cursor field 'WA_CODFOD-C_NOTE_NO' line mline.
    The value of MLINE can be from 1 and N, where N is the number of the lines shown in the table control, so if your table control can display 5 line, MLINE will be from 1 to 5.
    Now you need to create the link between the line of the table control and the line of internal table, the rule is:
    Internal Table Line = <table control>-TOP_LINE + <table control line> - 1.
    Max

  • Fast Refresh using two non-primary key tables

    Hi,
    I have a materialized view based on two tables with an outer join clause. Both the tables do not have a primary key so I had created materialized view log with row-id on each of them but still I am not able to bring out the fast refresh option for the materialized view. My question is can I have a fast refresh option for materialized view built from two tables without primary keys and having an outer join clause????. If possible please send me some sample scripts for quicker understanding.
    Thanks and Regards,
    Sudhakar

    I was able to create a fast-refreshable MV, on tables without any PK. Unfortunately, I can't complete all the steps since my setup is a multi-master advanced replication (which ABSOLUTELY requires the tables to have PK's). Here are anyway the steps I took. Note that ORA102 is my (definition) master site, and MVDB is my MV site. The tables were created under user HR, and my master group is called "hr_repg". Here are my steps:
    HR on ora102 >create table countries_no_pk as select * from countries;
    Table created.
    HR on ora102 >create table regions_no_pk as select * from regions;
    Table created.
    HR on ora102 >create materialized view log on countries_no_pk with rowid;
    Materialized view log created.
    HR on ora102 >create materialized view log on regions_no_pk with rowid;
    Materialized view log created.
    REPADMIN on ora102 >exec dbms_repcat.suspend_master_activity('hr_repg')
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.68
    REPADMIN on ora102 >BEGIN
    2 DBMS_REPCAT.CREATE_MASTER_REPOBJECT (
    3 gname => 'hr_repg',
    4 type => 'TABLE',
    5 oname => 'countries_no_pk',
    6 sname => 'hr',
    7 use_existing_object => TRUE,
    8 copy_rows => FALSE);
    9 END;
    10 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:05.19
    REPADMIN on ora102 >set timing off
    REPADMIN on ora102 >BEGIN
    2 DBMS_REPCAT.CREATE_MASTER_REPOBJECT (
    3 gname => 'hr_repg',
    4 type => 'TABLE',
    5 oname => 'regions_no_pk',
    6 sname => 'hr',
    7 use_existing_object => TRUE,
    8 copy_rows => FALSE);
    9 END;
    10 /
    PL/SQL procedure successfully completed.
    (note that you ABSOLUTELY need the rowid's in your select statement for an MV with joins):
    MVIEWADMIN on mvdb >CREATE MATERIALIZED VIEW hr.complex_mv refresh fast as
    2 select c.rowid "C_ROW_ID", r.rowid "R_ROW_ID", c.COUNTRY_ID, c.COUNTRY_NAME,
    3 c.REGION_ID, r.REGION_NAME from hr.regions_no_pk@ora102 r, hr.countries_no_pk@ora102 c
    4 where c.region_id = r.region_id (+);
    Materialized view created.
    MVIEWADMIN on mvdb >BEGIN
    2 DBMS_REPCAT.CREATE_MVIEW_REPOBJECT (
    3 gname => 'hr_repg',
    4 sname => 'hr',
    5 oname => 'complex_mv',
    6 type => 'SNAPSHOT',
    7 min_communication => TRUE);
    8 END;
    9 /
    PL/SQL procedure successfully completed.
    REPADMIN on ora102 >BEGIN
    2 DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (
    3 sname => 'hr',
    4 oname => 'countries_no_pk',
    5 type => 'TABLE',
    6 min_communication => TRUE);
    7 END;
    8 /
    PL/SQL procedure successfully completed.
    (wait when the entries in DBA_REPCATLOG is empty)
    REPADMIN on ora102 >exec dbms_repcat.resume_master_activity('hr_repg')
    Hope that can help you. If that doesn't work, tell us where it bombs.
    Daniel

  • Performance issue while extracting data from non-APPS schema tables.

    Hi,
    I have developed an ODBC application to extract data from Oracle E-Business Suite 12 tables.
    e.g. I am trying to extract data from HZ_IMP_PARTIES_INT table of Receivables application(Table is in "AR" database schema) using this ODBC application.
    The performance of extraction (i.e. number of rows extracted per second) is very low if the table belongs to non-APPS schema. (e.g. HZ_IMP_PARTIES_INT belongs to "AR" database schema)
    Now if I create same table (HZ_IMP_PARTIES_INT) with same data in "APPS" schema, the performance of extraction improves a lot. (i.e. the number of rows extracted per second increases a lot) with the same ODBC application.
    The "APPS" user is used to connect to the database in both scenarios.
    Also note that my ODBC application creates multiple threads and each thread creates its own connection to the database. Each thread extract different data using SQL filter condition.
    So, my question is:
    Is APPS schema optimized for any data extraction?
    I will really appreciate any pointer on this.
    Thanks,
    Rohit.

    Hi,
    Is APPS schema optimized for any data extraction? I would say NO as data extraction performance should be the same for all schemas. Do you run "Gather Schema Statistics" concurrent program for ALL schemas on regular basis?
    Regards,
    Hussein

  • Want to add rows from database in custom table model

    Hello all,
    I have written custom table model which has single blank row intially.
    Once user clicks on button, i want to add more rows in custom table model and display them in JTable.
    I have created JTable object as shown below.
    Jtable patientTable = new JTable( new DiagnosticTableModel());
    My custom tabel model is as shown below.
    import javax.swing.table.AbstractTableModel;
    public class DiagnosticTableModel extends AbstractTableModel
         private String[] columnNames = {
                         "Date",
                                              "Diagnosis",
                                              "Severity",
                                              "Medications"};
         private String[][] data = {
          public int getColumnCount()
             return columnNames.length;
          public int getRowCount()
               return data.length;
          public String getColumnName(int col)
             return columnNames[col];
          public Class getColumnClass(int col)
             return getValueAt(0, col).getClass();
          public Object getValueAt(int row, int col)
             return data[row][col];
          public boolean isCellEditable(int row, int col)
          return true;
          public void setValueAt(Object value, int row, int col)
             data[row][col] = value.toString();
             fireTableCellUpdated(row, col);
    }Thanx a lot in advance.

    I have written custom table model which has single blank row intially.Why did you write a custom TableModel? The DefaultTableModel will work fine and it has methods that allow you to dynamically add rows to the table.

Maybe you are looking for

  • Oracle portal 9 and oracle webcenter and SSO

    dear team. we have oracle portal 9 and oracle webcetner in my orgnization. both have different usernames/passwords. is there a way to have only one single username/password (webcenter ones) how can i do that. or even can we implement SSO thrugh windo

  • Azure indexer for dynamic packaged asset

    Hi I have an mp4 uploaded in the media services and I ran the Azure encoder to create a dynamic package of the video. I also ran the Azure indexer to create the index files for captions. I am using the Azure Media Player using the iframe code below i

  • Can't install EB 3

    Hello,  I'm trying to install Extension Builder 3 but I keep running the following error. Any suggestions for how to resolve this issue?  An error occurred while collecting items to be installed session context was:(profile=epp.package.java, phase=or

  • What is the major advantage of Repair full request?

    Hi gurus What is the major advantage of Repair full request? Thanks in advance Raj

  • App Store problems after upgrading to Mavericks

    after upgrading to mavericks, i can't update my apps via the app store.  I see there are updates, but it won't let me get to the update pane.  it stays on the featured.  i can't get to top charts, categories, or purchases either.