Efficiency of using Views over Joins

Hi All,
Which is the most efficient way for selecting data for the following scenario :
Selecting data from three tables using JOINs alongwith FOR ALL ENTRIES or using the View for the same(as the View is available).
Performance wise, which is better?
Thanks,
Arshad

Arshad,
Inner Join VS Outer Join:
TABEL1 inner join TABLE2:
only entries found in TABLE1 and TABLE2 are the result.
TABEL1 outher join TABLE2:
all entries found in TABLE1 and, if found the corresponding data from TABLE2 are the result.
For inner and outer join see the below thread:
difference..inner join and outer join
Views : Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
For View see the below thread:
Regarding Creating views
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ec77446011d189700000e8322d00/frameset.htm
ex for inner join:
Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
| a4 | b4 | c4 | 3 | |--||||--|
Inner Join
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
1
e1
f1
g1
h1
| a4 | b4 | c4 | 3 | 3 | e2 | f2 | g2 | h2 |
here common field is 'D' in both tables. after the inner join only the records from both the tables come where the D values in both the tables are same.
ex for outer join:
Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
| a4 | b4 | c4 | 3 | |--||||--|
Left Outer Join
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
1
e1
f1
g1
h1
a3
b3
c3
2
NULL
NULL
NULL
NULL
NULL
| a4 | b4 | c4 | 3 | 3 | e2 | f2 | g2 | h2 |
here all the records of table 1 come and if D value does not match in table 2 it is filled with NULL value.
View is a combination of 2 or more tables, only in the run time it contains data.
Pls. Mark if useful

Similar Messages

  • Question about using views in joins

    I have a question that is related to views. When a view is joined with another table, how does Oracle internally handle it? Does it create a temporary table that contains the resultant rows of the view and join that temorary table to the other table or does it use the view's SQL and embed it into the join condition?
    Thanks.
    Edited by: soleil4716 on Aug 13, 2010 11:58 AM

    soleil4716 wrote:
    I have a question that is related to views. When a view is joined with another table, how does Oracle internally handle it? Does it create a temporary table that contains the resultant rows of the view and join that temorary table to the other table or does it use the view's SQL and embed it into the join condition?
    No oracle do not create temporary table to joining table and views.There no difference joining just table<=>table and table<=>view.There is important join condition,and oracle will join these table and view according these conditions.

  • 10g doing VIEW type join even when no view in SQL - and performing poorly

    Using 10.2.0.2.0
    Every once in a while I see CBO deciding to use VIEW type join even when there is no view in the SQL and whenever it does that the performance just sucks.
    Example –
    SQL-
    SELECT a.emplid, a.empl_rcd, TO_CHAR (((a.dur) + (:"SYS_B_00")), :"SYS_B_01"),
    a.seqnum
    FROM ps_wrk_adhoc_tao5 a, ps_tl_prof_wrk5 b, ps_tl_empl_data c
    WHERE a.dur =
    (SELECT MAX (a1.dur)
    FROM ps_wrk_adhoc_tao5 a1
    WHERE a1.process_instance = :"SYS_B_02"
    AND a1.emplid = a.emplid
    AND a1.empl_rcd = a.empl_rcd)
    AND a.dur < TO_DATE (:"SYS_B_03", :"SYS_B_04")
    AND NOT EXISTS (
    SELECT :"SYS_B_05"
    FROM ps_tl_ta_exceptn5 q
    WHERE q.process_instance = :"SYS_B_06"
    AND q.exception_id = :"SYS_B_07"
    AND q.emplid = a.emplid
    AND q.empl_rcd = a.empl_rcd
    AND q.dur = a.dur)
    AND :"SYS_B_08" = :"SYS_B_09"
    AND c.emplid = a.emplid
    AND b.emplid = a.emplid
    AND c.empl_rcd = a.empl_rcd
    AND b.empl_rcd = a.empl_rcd
    AND c.effdt =
    (SELECT MAX (c1.effdt)
    FROM ps_tl_empl_data c1
    WHERE c1.emplid = c.emplid
    AND c1.empl_rcd = c.empl_rcd
    AND c1.effdt <= ((a.dur) + (:"SYS_B_10")))
    AND b.effdt =
    (SELECT MAX (b1.effdt)
    FROM ps_tl_prof_wrk5 b1
    WHERE b1.process_instance = :"SYS_B_11"
    AND b1.emplid = b.emplid
    AND b1.empl_rcd = b.empl_rcd
    AND b1.effdt <= ((a.dur) + (:"SYS_B_12")))
    AND c.time_rptg_status = :"SYS_B_13"
    AND b.empl_status IN (:"SYS_B_14", :"SYS_B_15", :"SYS_B_16", :"SYS_B_17")
    AND a.process_instance = :"SYS_B_18"
    AND b.process_instance = :"SYS_B_19"
    Plan –
    Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE 1 18
    NESTED LOOPS ANTI 1 153 13
    NESTED LOOPS 1 125 12
    NESTED LOOPS 1 103 10
    HASH JOIN 1 76 9
    INDEX RANGE SCAN SYSADM.PS0WRK_ADHOC_TAO5 7 245 2
    SORT AGGREGATE 1 21
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_WRK_ADHOC_TAO5 6 126 3
    INDEX RANGE SCAN SYSADM.PS_WRK_ADHOC_TAO5 6 2
    VIEW SYS.VW_SQ_1 524 20 K 6
    HASH GROUP BY 524 40 K 6
    FILTER
    MERGE JOIN 1 K 124 K 5
    SORT JOIN 151 5 K 2
    INDEX RANGE SCAN SYSADM.PS_TL_PROF_WRK5 151 5 K 1
    SORT JOIN 214 8 K 3
    INDEX RANGE SCAN SYSADM.PS0WRK_ADHOC_TAO5 214 8 K 2
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_TL_PROF_WRK5 1 27 1
    INDEX UNIQUE SCAN SYSADM.PS_TL_PROF_WRK5 1 0
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_TL_EMPL_DATA 1 22 2
    INDEX RANGE SCAN SYSADM.PS_TL_EMPL_DATA 1 1
    SORT AGGREGATE 1 20
    FIRST ROW 1 20 2
    INDEX RANGE SCAN (MIN/MAX) SYSADM.PS_TL_EMPL_DATA 1 20 2
    INDEX RANGE SCAN SYSADM.PS_TL_TA_EXCEPTN5 1 28 1
    If I use a rule hint here I get this plan. I get the plan given below on another database even without the rule hint –
    Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
    SELECT STATEMENT Optimizer Mode=HINT: RULE
    FILTER
    FILTER
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_TL_EMPL_DATA
    NESTED LOOPS
    NESTED LOOPS
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_TL_PROF_WRK5
    INDEX RANGE SCAN SYSADM.PS_TL_PROF_WRK5
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_WRK_ADHOC_TAO5
    INDEX RANGE SCAN SYSADM.PS_WRK_ADHOC_TAO5
    INDEX RANGE SCAN SYSADM.PS_TL_EMPL_DATA
    SORT AGGREGATE
    TABLE ACCESS BY INDEX ROWID SYSADM.PS_WRK_ADHOC_TAO5
    INDEX RANGE SCAN SYSADM.PS_WRK_ADHOC_TAO5
    INDEX RANGE SCAN SYSADM.PS_TL_TA_EXCEPTN5
    SORT AGGREGATE
    INDEX RANGE SCAN SYSADM.PS_TL_EMPL_DATA
    SORT AGGREGATE
    INDEX RANGE SCAN SYSADM.PS_TL_PROF_WRK5
    The whole schema was analyzed using dbms.stats only yesterday. My question is why is Oracle doing VIEW, and how can I stop it from doing that. Hint is not an option.

    I understand that SQL Developer takes it's NLS settings from Preferences - Database - NLS Parameters. What I was not aware of is that when SQL Developer is run for the first time the NLS Parameters seem to be populated from the settings on the OS of the PC it is running on. To test that this was the case I did the following
    I work on a Windows XP system with Regional Options - Standards and Formats and Regional Options - Location set with English (United Kingdom) and United Kingdom respectively.
    I unzipped two clean SQL Developer instances (both Version 1.2.1). The first instance I first ran under my current PC set up without importing settings from a previous installation. The Preferences - Database - NLS Parameters - Language and Preferences - Database - NLS Parameters - Territory had been populated with English and United Kingdom.
    I then changed the Regional Options on the OS to English (United States) and United States and ran the second instance of SQL Developer for the first time, again without importing settings. In this instance of SQL Developer the NLS Parameters were populated with American and America.
    When the first instance of SQL Developer was the checked under these OS settings the NLS Parameters were still English and United Kingdom.
    I was not aware this was the case and, if my test is correct, it seems to contradict the SQL Developer user guide http://download.oracle.com/docs/cd/E10405_01/doc/appdev.120/e10406/intro.htm#CHDBHCAG
    James
    Message was edited by: Jampat to include SQL Developer version number.

  • ETL for Data warehouse - use view instead of transformations?

    When populating staging tables, is anyone else using this approach of using a view - as opposed to transformations within your ssis dataflow ?  I had not thought of this approach, but I suppose it results in the same goal - to get the wanted schema
    for data flowing into the destination.  I suppose it would be just a matter of using the view as your source - as opposed to the underlying table(s), followed by transformations before the destination?

    Hi sb,
    I would say that it depends.  You want your load to be efficient and your want your load to be simple and easy to enhance later.  Sometimes these goals can be conflicting, so you need to decide what's important for your implementation.
    Regarding efficiency, you will typically be better off with a view as the filtering, lookups etc will be done at source, so less data transferred to your staging area.  For example, the view might only ask for 12 of 25 columns in a source table, so
    you will be bringing over, perhaps, half the amount of data.  Another example, your view might join two tables at source, while another design option would bring over all of the larger table and perform a lookup (on the smaller table) for each record
    of the larger table.  This could be extremely inefficient if each lookup went back to source.
    Regarding easy enhancements, in the first example, if you bring over all 25 columns, you might find it easier to add one of the, as yet, unused 13 columns.  Regarding the second example above, with views, there is a risk that a new view will be created
    for new requirements, resulting in multiple views importing overlapping data.  You really only want to import each datum once, with no duplication.  Note; duplication is unlikely if the views are essentially one view per logical table in the source
    system.
    I've sat on the fence a bit answering this question, but it really does depend, and it is a big question.  What you need to do is understand the ramifications of the design you implement.  Having qualified my response, I very often use views to
    perform simple 1:1 mainipulation of the source data.
    Hope that helps a little,
    Richard

  • Query using views

    Since the query is too big, I have removed the query from the post.
    I would like to know whether using views in SQL queries degrade the performance of the queries?
    When views are used in sql queries, the operation 'FILTER' is displayed in the explain plan, however the cost doesnt seem to be high. If the views can be replaced by the base tables, it is better to do so?
    Edited by: user642116 on Nov 8, 2008 11:13 PM

    user642116 wrote:
    I have a main table called NATURAL_PERSON. There are several child tables based on this table, for e.g. PERSONAL_DETAILS, NATIONALITY_PERSON, CIVIL_STATUS etc. All these child tables have a foreign key NPN_ID which is joined with the ID of NATURAL_PERSON.
    I need to obtain data from these child tables and present in them xmlformat.
    A part of the query used is as below
    SELECT npn.ID npn_id,
    CONVERT(xmlelement("uwvb:NaturalPerson",
              XMLForest(LPAD(npn.nat_nummer,9,0) AS "uwvb:NatNr"),
              (XMLForest(LPAD(per.a_nummer, 10, 0) AS "uwvb:ANr"
              (SELECT XMLFOREST
                        (code_status AS "uwvb:ResidenceStatus")
                        FROM ebv_v_nep nep
                        WHERE npn_id = npn.ID
                        AND nep.nem_code = 'VBT'
                        AND nep.transactid =
                        (SELECT MAX (nep_i.transactid)
                             FROM ebv_v_nep nep_i
                             WHERE nep.npn_id = nep_i.npn_id
                             AND nep_i.nem_code = 'VBT'))
              entityelement),'WE8MSWIN1252', 'UTF8')
    FROM ebv_v_npn npn, ebv_v_per per
    WHERE npn.ID = per.npn_id
    As seen in the above query, views have been defined for all the tables. For e.g. the view ebv_v_npn is based on NATURAL_PERSON, ebv_v_per is based on PERSONAL_DETAILS, ebv_v_nep is based on RESIDENCE STATUS. All these views are independent of each other and do not contain common tables in their definition.
    The views can be replaced by the base tables as i dont see any advantage of using the views. I would like to know whether replacing the views with the base tables would also help to improve the performance.Replacing the views with the base tables might help, since not always Oracle is able to merge the views, so sometimes certain access paths are not available when working with views compared to accessing the base tables directly.
    You can see this in the execution plan if there are separate lines called "VIEW". In this case a view wasn't merged.
    The particular query that you've posted joins two views in the main query and (potentially) executes a scalar subquery that contains another correlated subquery for each row of the result set. "Potentially" due to the cunning "Filter optimization" feature of the Oracle runtime engine that basically attempts to cache the results of scalar subqueries to minimize the number of executions.
    If the statement doesn't perform as expected you need to find out which of the two operations is the main contributor to the statement's runtime.
    You can use DBMS_XPLAN.DISPLAY to find out what the FILTER operation you mentioned is actually performing (check the "Predicates Information" section below the plan output), and you can use SQL tracing to find out which row source generates how many rows. The following document explains how to enable SQL tracing and run the "tkprof" utility on the generated trace file: When your query takes too long ...
    The correlated subquery of the scalar subquery that is used to determine the maximum "transactid" may be replaced with a version of the statement that uses an analytic function to avoid the second access to the view (note: untested):
    SELECT npn.ID npn_id,
      CONVERT(xmlelement("uwvb:NaturalPerson",
              XMLForest(LPAD(npn.nat_nummer,9,0) AS "uwvb:NatNr"),
              (XMLForest(LPAD(per.a_nummer, 10, 0) AS "uwvb:ANr"
              (SELECT XMLFOREST
        (code_status AS "uwvb:ResidenceStatus")
        FROM (
          SELECT code_status,
          RANK() over (PARTITION BY npn_id ORDER BY transactid desc) as rnk
          FROM ebv_v_nep nep
          WHERE nep.npn_id = npn.ID
          AND nep.nem_code = 'VBT'
        where rnk = 1)
        entityelement),'WE8MSWIN1252', 'UTF8')
    FROM ebv_v_npn npn, ebv_v_per per
    WHERE npn.ID = per.npn_idRegards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/
    Edited by: Randolf Geist on Nov 10, 2008 9:27 AM
    Added the rewrite suggestion

  • A view over XML that is not 1:1

    I'm going to provide a simple view over a rather complex XML structure. For the view it makes sense (to the legacy application) to split and join some XML elements. But how to do it ? This seems to be impossible with a plain xmltable(). Do I have to resort to separate xmlquery() function calls for those items I need to manipulate ? How to do it ?
    I'm running Oracle 11gR2 (11.2.0.1.0)
    create table otn4test(
      id number,
      data xmltype
    insert into otn4test values (1, xmltype('
    <root>
      <elem>
        <code>123descriptivetext</code>
        <issuer>abcd</issuer>
      </elem>
      <elem>
        <code>124descriptivetext</code>
        <issuer>efgh</issuer>
      </elem>
    </root>'));
    -- this works fine as expected
    create or replace view otn4view as
    select x.*
    from otn4test,
         xmltable('/root/elem' passing otn4test.data
         columns
         code varchar2(30) path 'code',
         issuer varchar2(4) path 'issuer'
         ) x;
    select * from otn4view;
    /* But how to
    A) Split the output like:
    CODE TEXT            ISSU
    123  descriptivetext abcd
    124  descriptivetext efgh
    B) Join the output like:
    TEXT
    code = 123 text = descriptivetext issuer = abcd
    code = 124 text = descriptivetext issuer = efgh
    drop view otn4view;
    drop table otn4test;

    Hi,
    Herald's suggestion will work provided you add a function to build the string out of the generated sequence.
    For example :
    SQL> select x.*
      2  from otn4test,
      3       xmltable('/root/elem' passing otn4test.data
      4         columns
      5         fulltext varchar2(100)
      6                  path 'string-join(("code = ",substring(code,1,3)," text = ",substring(code,4), " issuer = ",issuer),"")'
      7       ) x
      8  ;
    FULLTEXT
    code = 123 text = descriptivetext issuer = abcd
    code = 124 text = descriptivetext issuer = efgh
    Or, using concatenation :
    SQL> select x.*
      2  from otn4test,
      3       xmltable('/root/elem' passing otn4test.data
      4         columns
      5         fulltext varchar2(100)
      6                  path 'concat("code = ",substring(code,1,3)," text = ",substring(code,4), " issuer = ",issuer)'
      7       ) x
      8  ;
    FULLTEXT
    code = 123 text = descriptivetext issuer = abcd
    code = 124 text = descriptivetext issuer = efgh
    Depending on the amount of data, you'll probably want to test SQL functions as well.

  • View and join Table

    Hi,
      what is the differnce between view and join table

    Hi,
    There are 4 types of views in SAP.
    Database View - To club more than one table
    Projection View - To hide fields in one table
    Maintenance View - To maintain database records in table
    Help View - To provide help for a fields (Same functionality as Search help. This is outdated)
    View are improves performance in the following aspects
    1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improves performance of a program
    2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.
    Note:
    1.Views does not contain data in it. It fetches data from the database only depending on the condition ...
    2.Views are part of data dictionary. They are a window to view the data in database
    3.views can be used to give security to data. users can be allowed to view only basic data only
    For More Info,go thru this Threads,
    join
    Views vs Inner Join
    Regards,
    Padmam.

  • Create a classification view over bapi

    Hello,
    i start a vb Programm to create a material in sap.
    I get all views with material_savedata but the classification view is missing.
    Does anybody know if there exist a special bapi to create a classification view
    over the .net connector ?
    thanks for any help

    Hello , thanks a lot for the answers. I am using a vb programm with the proxy connector.
    In this connector i have defined:
            Dim oClassnum As String
            Dim oClasstype As String
            Dim oKeydatum As String
            Dim oLanguage As String
            Dim oObjectkey As String
            Dim oObjecttable As String
            Dim oUnvaluated_char As String
            Dim oStandardklasse As String
            Dim oStatus As String
            Dim oAllocvaluechar As New BAPI1003_ALLOC_VALUES_CHARTable
            Dim oAllocvaluecurr As New BAPI1003_ALLOC_VALUES_CURRTable
            Dim oAllocvaluesnum As New BAPI1003_ALLOC_VALUES_NUMTable
            Dim oReturn0 As New BAPIRET2Table
    Try
                oProxy.Bapi_Objcl_Getdetail(oClassnum, oClasstype, oKeydatum, _
                oLanguage, _
                oObjectkey, oObjecttable, oUnvaluated_char, oStandardklasse, _
                oStatus, oAllocvaluechar, _
                oAllocvaluecurr, oAllocvaluesnum, oReturn0)
                MsgBox(oReturn0.Item(0).Message.ToString)
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
    When i start the programm i get the error:
    The function  OBJECT_CHECK_ does not exist. 
    WHY ??
    I have also tried to use 
    Bapi_Charact_Getdetail
    to test, if something works but i really do'nt know what the meaning of
    the parameters are . Perhaps somebody can explain them to me.
    I have tried with charactername and used a  *  but the result is always 0.
    Has somebody a documentation of the fields and tables that are
    needed or filled or a little example of the us of the classification.
    thanks a lot

  • Using Case and Joins in update statement

    Hi all,
    I need to update one column in my table...but need to use case and joins...I wrote the query and it is not working
    I am getting an error msg saying...the SQL command not ended properly...
    I am not that good at SQL...Please help...
    update t1 a
    set a.name2=
    (case
    when b.msg2 in ('bingo') then '1'
    when b.msg2 in ('andrew') then '2'
    when b.msg2 in ('sam') then '3'
    else '4'
    end )
    from t1 a left outer join t2 b
    on a.name1 = b.msg1 ;
    Waiting for help on this...!
    Thanks in Advance... :)

    Another approach is to update an inline view defining the join:
    update
    ( select a.name2, b.msg2
      from   t1 a
      join   t2 b on b.msg1 = a.name1 ) q
    set q.name2 =
        case
          when q.msg2 = 'bingo' then '1'
          when q.msg2 = 'andrew' then '2'
          when q.msg2 = 'sam' then '3'
          else '4'
        end;which could also be rewritten as
    update
    ( select a.name2
           , case q.msg2
                when 'bingo'  then '1'
                when 'andrew' then '2'
                when 'sam'    then '3'
                else '4'
             end as new_name
      from   t1 a
      join   t2 b on b.msg1 = a.name1 ) q
    set name2 = new_name;The restriction is that the lookup (in this case, t2.msg1) has to be declared unique, via either a primary or unique key or unique index.
    (You don't strictly need to give the view an alias, but I used 'q' in case you tried 'a' or 'b' and wondered why they weren't recognised outside the view.)

  • Materialized View with Joins

    Dear Dev/DBAs,
    I have the following scenario:
    SQL> CREATE TABLE T1 (ID NUMBER(3),NAME VARCHAR2(10));
    SQL> CREATE TABLE T2 (ID NUMBER(3),NAME VARCHAR2(10));
    The T1 contains records having the ID num from 10 to 80 and the T2 having the ID from 90 to 170
    SQL> SELECT * FROM T1 JOIN ALL SELECT * FROM T2
    It give all records in the 2 tables.
    I'm planning to create a materialized view (like CREATE MATERIALIZED VIEW V_TAB REFRESH ON COMMIT AS SELECT * FROM T1 JOIN ALL SELECT * FROM T2) and it seems i can't do with the error ORA-12054, further the oracle documentation says that materialized view can only be used with a simple join.
    Do you have another solution??
    Note that the materialized views can be used to improve queries.
    Thank you in advance

    Straight from the link I posted:
    *Restrictions on Fast Refresh on Materialized Views with UNION ALL*Materialized views with the UNION ALL set operator support the REFRESH FAST option if the following conditions are satisfied:
    * The defining query must have the UNION ALL operator at the top level.
    The UNION ALL operator cannot be embedded inside a subquery, with one exception: The UNION ALL can be in a subquery in the FROM clause provided the defining query is of the form SELECT * FROM (view or subquery with UNION ALL) as in the following example:
    CREATE VIEW view_with_unionall AS
    (SELECT c.rowid crid, c.cust_id, 2 umarker
    FROM customers c WHERE c.cust_last_name = 'Smith'
    UNION ALL
    SELECT c.rowid crid, c.cust_id, 3 umarker
    FROM customers c WHERE c.cust_last_name = 'Jones');
    CREATE MATERIALIZED VIEW unionall_inside_view_mv
    REFRESH FAST ON DEMAND AS
    SELECT * FROM view_with_unionall;
    Note that the view view_with_unionall satisfies the requirements for fast refresh.
    * Each query block in the UNION ALL query must satisfy the requirements of a fast refreshable materialized view with aggregates or a fast refreshable materialized view with joins.
    The appropriate materialized view logs must be created on the tables as required for the corresponding type of fast refreshable materialized view.
    Note that the Oracle Database also allows the special case of a single table materialized view with joins only provided the ROWID column has been included in the SELECT list and in the materialized view log. This is shown in the defining query of the view view_with_unionall.
    * The SELECT list of each query must include a maintenance column, called a UNION ALL marker. The UNION ALL column must have a distinct constant numeric or string value in each UNION ALL branch. Further, the marker column must appear in the same ordinal position in the SELECT list of each query block.
    * Some features such as outer joins, insert-only aggregate materialized view queries and remote tables are not supported for materialized views with UNION ALL.
    * Partiton Change Tracking (PCT)-based refresh is not supported for UNION ALL materialized views.
    * The compatibility initialization parameter must be set to 9.2.0 or higher to create a fast refreshable materialized view with UNION ALL.

  • Materialized view with join

    In 10g release 2,I tried to create following materialized view with join:
    test_link is a normal table
    test_geom is a table contains a column in SDO_GEOMETRY
    CREATE MATERIALIZED VIEW LOG ON test_link with rowid
    CREATE MATERIALIZED VIEW LOG ON test_geom with rowid,primary key
    CREATE MATERIALIZED VIEW MV_LINK USING INDEX REFRESH FAST ON DEMAND AS
    SELECT li.rowid link_rowid,geom.rowid geom_rowid,li.link_id,geom.link
    FROM test_link li, test_geom geom
    WHERE li.link_id=geom.link_id
    But I always got an error like:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    If I change the geometry table to another table, everything works fine.
    Anyone have ideas?

    Unfortunately, creating a fast refreshable materialized view on a join with one of the select columns being a user defined type (sdo_geometry is a user defined type) is not allowed. See 5303489 in the metalink bug database.
    You could do like the workaround in the article suggests and create two materialized views and then create a regular view on top.
    In our scenario, our materialized view also contains unions, so we would really like to have one physical object at the end of the day. One approach that we are currently investigating is to create the materialized view (MV1) without the geometry column, which makes it fast refreshable, and also create a materialized view (MV2) on the table containing the geometry column. MV2 is also fast refreshable. We then create a table (T3) that contains all of the columns from MV1, plus a geometry column. An insert, update, delete trigger on MV1 is created. The trigger is used to push all of the columns from MV1 to T3 and the geometry column from MV2 to T3. I have created the above in one of our test environments and haven't encountered any issues yet.
    Let me know if you come up with a better approach.

  • When to go for generic extraction using view and infoset query?

    Hi,
                        Can anyone clarify me when we should go for generic extraction using view and when we should go for generic extraction using infoset query....
    Also what is the difference between view and infoset?
    I tried but could not find out....
    Regards,
    Kalyani.

    Hi Kalyani,
    We normally go for View or infoset when the data to be fetched in BW is distributed in different tables in SAP R/3.
    Had the data been available in one table we can easily build our datasource on that table but if there are more tables then its not possible to do it without Views or Infosets. You can use Function Modules to build your datasource in case it involves complex logic to figure out the data from various tables.
    Depending upon the table relationships we create view and include various fields from these tables in that view. Same is with the Infosets, you can have more flexible options like Outer Join, left outer Join etc.
    Regards,
    Pratap Sone

  • Basic view/stream join problem (Logical Operator LO_CROSS error)

    Hi -
    I am writing a CQL processor which processes a stream of events. It translates them 1:1 to another type of event, and also assigns a calculated Version field to the output events.
    The inbound events have an ID field which may contain duplicates. The version is an internal sequence starting at 1 for each ID, and incrementing by ID each time another instance of that ID is seen.
    Sample input (schema: ID, Payload):
    1, abc
    2, abc
    3, abc
    1, def
    4, abc
    2, defDesired output (schema: ID, Version, Payload):
    1, 1, abc
    2, 1, abc
    3, 1, abc
    1, 2, def
    4, 1, def
    2, 2, defI have defined a processor with a view that aggregates the inbound events in a fixed depth relation (I receive fewer than 1000 events/versions per ID), and try to join that to a transform query:
    <view id="Versioner">
      select id, count(*)+1 as version
      from inboundEvents [partition by id rows 1000]
      group by id
    </view>
    <query id="Translator">
      select payload, ..., f.id, v.version
      from inboundEvents as f, Versioner as v
      where f.id=v.id
    </query>Question 1 - when deploying, CEP gives this error, which I don't understand. What basic error am I making?
    Description: unbound stream not allowed
    Cause: A stream input was applied to Logical Operator LO_CROSS
    Action: Do not use stream input for Logical Operator LO_CROSS> Question 2 - is there a better CQL pattern for this - it is ugly to need to fix the partition depth to 1000.
    -thanks, Barney
    Edited by: Barney on 10-Aug-2011 10:59

    Q1 -"inboundEvents" is a Stream and a Stream without a window cannot be used in a Join
    You could instead use the query
    <query id="Translator">
    RSTREAM (
      select payload, ..., f.id, v.version
      from inboundEvents[NOW] as f, Versioner as v
      where f.id=v.id
    </query>Q2 - You do not need the PARTITION window. Instead, just use
    <view id="Versioner">
      select id, count(*)+1 as version
      from inboundEvents
      group by id
    </view>

  • WVC80N - Internet Gateway UPnP discovery failure message \ unable to view over the internet

    I have the WVC80N.  I recently got the new Comcast modem \ wifi but the Wifi is junk and had a lot of problems (loss connection, range etc) so I had Comcast "bridge" it so I just use my old wifi (LinkSys E1200).   I have TZO to handle remote viewing.  Everything was working great for about two weeks and we had a power outage.  Since then, I have been getting UPnP discovery message (in the status tab of the WVC80N camera site) and I am unable to view over the internet.  I get a 502 error usually but today I got extra info: "The socket connection to www.dfgehring.mylinksyscam.com failed.
    ErrorCode: 10060.  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
    I had Comcast do a "repair / reset" transmission to the modem and still get the problem.
    I found these step on the forum:
      1. Home Wirless Rounter administration page, find the UnPn settings and Turn off UnPn and save it. Wait for atleast 30 sec  and go the same page and Turn it back on.
      2. On your wireless camera Adminstraion page, go to "Options" and find the UnPn if it is already disabled go ahead and "enable" it also "enable" the "Alternate web connection" and save it. If it was already enable please disable it save the settings and enable back on.
     The above 2 steps resolved my issue and I could able to view my camera from outside of my home network.
    Still no luck.  Tried it several times.
    Could the power outage reset something on the modem or router to change this? 
    Thanks
    Darren

    That's what I thought. The power outage may have set the modem, router or camera settings back to factory defaults causing it to loose connection. First thing first, call comcast and check if the modem is still on bridge mode. The modem may have been set back to a modem/router mode due to power outage.
    You may test if the remote access is properly set up in the network by going to http://ping.eu. In that site, you will see your internet ip address, take note of that. Click on port check, enter your internet ip address and the port number you used in the alternate web access port then click Go. If it says closed, there something wrong in the settings of either the router or camera. In that case, I suggest you reset the router and camera and then reconfigure them.
    I found these articles online which could help you reconfigure your router and camera settings:
    How to set up your router
    How to set up router wireless setting
    Connecting camera to wireless network
    How to set up remote access on linksys camera
    How to set up TZO on the linksys camera
    Hope these helps.

  • Driving Automator using Voice Over

    Hello,
    I am visually impaired and so use Voice Over for all MAC access. I am trying to create a workflow to speak the current time. Using Voice Over without sighted assistance I can access the required actions and variables but alas I cannot fathom out how to combine the actions into a workflow. I cannot find an edit area or whatever where I can view the actions so far and move them around as necessary.The MacHelp tells me to drag and drop the necessary actions and variables into the panel on the right (or words like that) but, of course, I cannot do that using Voice Over. I tried copy and paste but to no effect, primarily because I could not find the place to paste the actions into.
    So if anyone has successfully driven Automator using Voice Over without sighted help then please pass on your tips!
    Many thanks.
    Paul Hopewell
    [email protected]

    All I can suggest is to look at the instructions in the Users Guide. There is a lot on VoiceOver. See chapter 31 of
    manuals.info.appleipod_touch-6.1-_user_guide.pdf

Maybe you are looking for

  • Changes made in jsp are not reflected

    webpages are not reflected after modifying jsp pages what i need to do?? thanks in advance

  • SQL Error: ORA-00936: missing expression

    Hello all, sorry i can't speak english very well i would like to know what's wrong on my code CREATE TABLE MOB (MOBILE VARCHAR2(20)); Insert into EXPORT_TABLE (MOBILE) values ('0124873214'); Insert into EXPORT_TABLE (MOBILE) values ('0184873214'); In

  • Need a Price List Tutorial

    I feel somewhat stupid asking this question, but I just can't seem to figure this out.  I have the default 10 price lists synching from B1 to WebTools, though I did rename 5 of them that I am using.  Below are my mappings (B1 on left, WebTools on Rig

  • How does the extractor in FXCollections.observableList work?

    How is the "extractor" supposed to work for ObservableLists? According to the JavaDoc it should trigger a update: > This list also reports mutations of the elements in it by using extractor. Observable objects returned by extractor (applied to each l

  • How to limit the duration of a scheduler could run?

    I scheduled a procedure A with HOURLY frequency. Normally, A could complete within 20 minutes. However, there are exceptions that it could run more than 60 minutes. In order to minimize the impact of next execution of A, I want to kill/stop the proce