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

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

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

Similar Messages

  • Materialized Views and Substr ?

    Hi,
    I'm currently trying to create a materialized view that can be fast refreshed, but it complains each time. I think it's because I'm using a constraint substr(x,1,10) so complete refreshes are all that can be done?
    My steps are :
    create materialized view log on a_table with rowid;
    create materialized view log on b_table with rowid;
    create materialized view log on c_table with rowid;
    create materialized view log on d_table with rowid;
    and the materialized view is
    create materialized view MY_VIEW
    build immediate
    enable query rewrite
    REFRESH FAST
    as
    SELECT bt.mid AS mid, ct.imid AS imid, bt.iid AS iid, vendor_name AS make, at.dname AS dname, bt.timestamp AS timestamp
              FROM b_table bt, c_table ct, d_table dt, a_table at
                   WHERE bt.mid=ct.mid
                        AND substr(bt.iid,1,5)=dt.val1
                        AND at.profile_id=dt.profile_id
              order by bt.timestamp desc;
    ORA-12052: cannot fast refresh materialized view MY_VIEW
    I'm at a loss, I can make it without the fast refresh, but the table view is huge and updating it completely each time isn't going to work :(
    Any help or suggestions would be greatly appreciated,
    Regards,
    Brian

    Well, basically, you can relatively easily find it out yourself.
    First, there is a very useful script $ORACLE_HOME/rdbms/admin/utlxmv.sql
    You should execute under the same account as you create materialized views like this
    @?/rdbms/admin/utlxmvThen you are prepared to check, whether your mv is fast refresheable and if not - why.
    SQL> create table new_dept as select * from dept
      2  /
    Table created.
    SQL> -- Now create table emp with new join column of type varchar2
    SQL> create table new_emp as
      2  select e.*,d.dname
      3  from emp e,dept d
      4  where e.deptno=d.deptno
      5  /
    Table created.
    SQL> create materialized view log on new_emp with rowid
      2  /
    Materialized view log created.
    SQL> create materialized view log on new_dept with rowid
      2  /
    Materialized view log created.
    SQL> begin
      2          dbms_mview.explain_mview('select e.*,d.loc
      3                  from new_emp e,new_dept d
      4                  where substr(d.dname,1,10)=e.dname');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select capability_name,possible,msgtxt
      2  from  mv_capabilities_table
      3  where capability_name like '%FAST%'
      4  /
    CAPABILITY_NAME                PO MSGTXT
    REFRESH_FAST                   N
    REFRESH_FAST_AFTER_INSERT      N  the SELECT list does not have the rowids
                                       of all the detail tables
    REFRESH_FAST_AFTER_ONETAB_DML  N  see the reason why REFRESH_FAST_AFTER_IN
                                      SERT is disabled
    REFRESH_FAST_AFTER_ANY_DML     N  see the reason why REFRESH_FAST_AFTER_ON
                                      ETAB_DML is disabled
    REFRESH_FAST_PCT               N  PCT is not possible on any of the detail
                                       tables in the materialized view
    SQL> rollback
      2  /
    Rollback complete.
    SQL> -- Now we know - for materialized view rowid of all involved in join tables
    SQL> -- should be in the select list to make possible fast refresh
    SQL> -- of course they should get proper aliases. Yet one attempt
    SQL> begin
      2    dbms_mview.explain_mview('select e.*,e.rowid erow_id,d.loc,d.rowid drow_id
      3      from new_emp e,new_dept d
      4      where substr(d.dname,1,10)=e.dname');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select capability_name,possible,msgtxt
      2  from  mv_capabilities_table
      3  where capability_name like '%FAST%'
      4  /
    CAPABILITY_NAME                PO MSGTXT
    REFRESH_FAST                   Y
    REFRESH_FAST_AFTER_INSERT      Y
    REFRESH_FAST_AFTER_ONETAB_DML  Y
    REFRESH_FAST_AFTER_ANY_DML     Y
    REFRESH_FAST_PCT               N  PCT is not possible on any of the detail
                                       tables in the materialized view
    SQL> -- Mission successful - refresh_fast is possibleBest regards
    Maxim

  • Materialized view and Partition

    Hi,
    I want to discuss a scenario, with which i am dealing nowadays. there is only a single table (named livecdr ) has 22-23 fields and the records are updating in every sec (on daily basis) and in 24hrs livecdr contains approximately more than 2 crore records.
    Problem is that the query processing time is so slow due to large number of records and query is fetching records from a view created on livecdr table. I want to know the options, how the query would fetch these records in a short time. Firstly i did range partitioning on livecdr and then i created materlized view but the view didn't create on partition table and when i removed partitioning it was created. After view creation, query performance is much better. i also applied indexing on livecdr.
    Can you please tell me, whether this approach is okay or i am doing mistake. should i create partitioning on materialized view and how would i select records from view if partitioning would be applied on materialized view. Please guide me with best approaches.
    thankyou.

    Hello,
    Here is how I created partitioned table (monthly partitions) and partitioned mview on the table. This is just an example you might have to change the mview partitions from monhtly to yearly or quartely.
    CREATE TABLE live_cdr
       CALLID              VARCHAR2 (20),
       CD                  VARCHAR2 (25),
       CG                  VARCHAR2 (25),
       RE                  VARCHAR2 (25),
       OPC                 VARCHAR2 (12),
       DPC                 VARCHAR2 (12),
       STIME               VARCHAR2 (25),
       SDATE               DATE,
       ATIME               VARCHAR2 (25),
       ADATE               DATE,
       ETIME               VARCHAR2 (25),
       EDATE               DATE,
       schangeTime         VARCHAR2 (25),
       schangeDate         DATE,
       STATUS              VARCHAR2 (25),
       bucket              NUMBER (20),
       CIC                 NUMBER (20),
       charge              VARCHAR2 (30),
       ported              VARCHAR2 (30),
       jurisdiction_Info   VARCHAR2 (30),
       origLine_Info       CHAR (1),
       Variant             NUMBER,
       auto_inc            NUMBER
    PARTITION BY RANGE (EDATE)
      PARTITION LIVE_CDR_JAN_2009 VALUES LESS THAN (TO_DATE(' 2009-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        LOGGING
        NOCOMPRESS, 
      PARTITION LIVE_CDR_FEB_2009 VALUES LESS THAN (TO_DATE(' 2009-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        LOGGING
        NOCOMPRESS
    );Mview definition
    CREATE MATERIALIZED VIEW KLONDIKE.LIVE_CDR_MV
    LOGGING
    PARTITION BY RANGE (EDATE)
      PARTITION LIVE_CDR_MV_JAN_2009 VALUES LESS THAN (TO_DATE('20090201',
          'YYYYMMDD'))
        LOGGING
        NOCOMPRESS,
      PARTITION LIVE_CDR_MV_FEB_2009 VALUES LESS THAN (TO_DATE('20090301',
          'YYYYMMDD'))
        LOGGING
        NOCOMPRESS
    BUILD IMMEDIATE
    REFRESH COMPLETE
    START WITH SYSDATE
    NEXT SYSDATE  + 2 /24
    AS
    SELECT   DISTINCT (ic.callid) callid,
                      ic.CG,
                      ic.CD,
                      ic.RE,
                      ic.OPC,
                      ic.DPC,
                      ic.SDATE,
                      ic.STIME,
                      ac.ADATE,
                      ac.ATIME,
                      ec.ETIME,
                      ec.EDATE,
                      ec.STATUS
      FROM   live_cdr ic, live_cdr ac, live_cdr ec
    WHERE       ic.callid = ac.callid
             AND ic.callid = ec.callid
             AND ic.stime = ac.stime
             AND ic.stime = ec.stime
             AND ic.sdate = ac.sdate
             AND ic.sdate = ec.sdate
             AND ac.ADATE IS NOT NULL
             AND ec.EDATe IS NOT NULL
             AND ec.etime IS NOT NULL
             AND ic.CD IS NOT NULL
             AND ic.cg IS NOT NULL;Regards

  • Updatable Materialized View and Master Table on same database

    Hi all,
    My first question - Is it possible to have an Updatable Materialized View and the associated Master Table located on the same database?
    This is the requirement scenario:
    One unique database D exists.
    A is a batch table. Only inserts are allowed on Table A.
    M is an updatable materialized view on Table A (Master). Only updates are allowed on M (no insert or delete).
    Requirement is to push updates/changes from M to A periodically and then get the new inserted records from A into M via a refresh.
    Is this possible? What other approaches are applicable here?

    John,
    My question is related to the implementation and setup of the environment as explained in the above example. How can I achieve this considering that I have created an updatable m-view?
    If possible, how do I push changes made to an updatable m-view back to it's master table when/before I execute DBMS_MVIEW.REFRESH on the m-view? What is the procedure to do this if both table and mview exist on the same database? Do I need to create master groups, materialized view refresh groups, etc.?
    One more thing.. Is there a way to retain changes to the m-view during refresh? In this case, only newly inserted/updated records in the associated table would get inserted into m-view. Whereas changes made to m-view records would stay as-is.
    Hope my question is directed well. Thanks for your help.
    - Ankit

  • Materialized View and I_SNAP$ Indexes

    Hello Everybody,
    At the time of doing REFRESH of the Materialized View, we are getting error like -
    SQL> EXECUTE DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF');
    BEGIN DBMS_MVIEW.REFRESH('MV_TEST.MY_VIEW,'CF'); END;
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-00001: unique constraint (MV_TEST.I_SNAP$_FIN_RESULT_EXPENSE1) violated
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
    ORA-06512: at line 1
    I tried to drop and recreate the index I_SNAP$_FIN_RESULT_EXPENSE1 but it didn’t helped.
    Later I dropped the index I_SNAP$_FIN_RESULT_EXPENSE1 and refreshed the materialized view and it was successful (obvious). But when I tried to recreate the index, I got the following error –
    SYS_OP_MAP_NONNULL("FIN_MULT"), SYS_OP_MAP_NONNULL("FIN_CD"))
    ERROR at line 8:
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    When I look at the value of SYS_OP_MAP_NONNULL('FIN_CD'), it seems to be unique.
    SQL> select SYS_OP_MAP_NONNULL('FIN_CD') from dual;
    SYS_OP_MAP_NONNULL('FIN_CD’)
    46494E5F5650545F4C564C5F335F434400
    My questions are:
    1.     Why are the indexes (I_SNAP$_*) automatically created for?
    2.     What is the purpose of these (I_SNAP$_*) indexes?
    3.     What harm can be there if we drop these (I_SNAP$_*) indexes?
    4.     Why it is complaining about the Duplicate records / Uniqueness?
    5.     How to know where exactly the problem is in this case?
    6.     What is the solution for this problem? How to recreate these indexes successfully?
    Thanks!

    Hello Rafi,
    I don't have any MLOG$_<table> in the database, After connecting as SYS -
    SQL> select tname from tab where tname like '%MLOG%';
    TNAME
    MLOG_REFCOL$
    MLOG$
    C_MLOG#
    SQL> select count(*) from mlog$;
    COUNT(*)
    0
    I am not using Replication here -
    SQL> select tname from tab where tname like '%RUPD%';
    no rows selected
    Why you think that granting SELECT access to MLOG$_* tables will solve this issue?
    Thanks,
    Roopesh

  • How to extract data from generic view and function module

    hi experts,
    can anybody give me the steps to extract data from generic view and  functon modules.
    thanks and regards
    venkat

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    https://websmp103.sap-ag.de/~sapidb/011000358700007535452002
    Hope it Helps
    Chetan
    @CP..

  • Diff materialized view and view

    what is diff materialized view and view

    Check these documents please
    [Overview of Materialized Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT411]
    [Overview of Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#i20690]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • Materialized view and snapshot

    Hi gurus,
    Could you please tell me what is the difference between materialized view and snapshot.
    Regards
    Koustav

    A snapshot, is in general terms, a picture, a click of a camera, an image that captures the position/state of something at sometime.
    Snapshot in a database can take many points of view.
    Materialized view (MV) is an object in Oracle database. It "materializes" a view, by taking a snapshot, of the view when you actually create the MV, and preserve it for future use. It can be refreshed in several available ways.
    A view doesn't occupy any space, a MV does.
    HTH,
    Aswin.

  • Materialized View and Ord Media questions

    Hey Guys,
    My first question is on the use and creation of materialized views which i have previously done using TOAD. The question that i have is where/if can i visually see the constraints that are on a materialized view and where is the information for "next refresh" times placed?
    Question two is about viewing informaiton on ord media objects that are stored. Previously, i had the ability to double click one of these elememts in the data view and see the information related to that instance of the ord media object, but the SQL developer does not seem to have this ability??
    Thanks in advance.

    Thanks Kris,
    The reason that i asked about the constraints on MV is because when you create a materialized view over a db link with primary key, it will place a not null constraint on every column. This is obviously no good because some rows are bound to contain nulls and these need to be removed and updated before it will work!
    As for the ord objects, it just makes it a little easier for testing to see what they are :).
    Anyway, its looking great and i hope these features will be in the next release?
    Cheers David

  • Materialized view and policies

    Hello,
    We created an materialized view and on this view why created a policy.
    SYS.DBMS_RLS.ADD_POLICY
    Now we added some values to the MV via drop MV and create MV.
    The policy on this MV is gone after the drop statement.
    Is there away to secure this?
    Thanks,
    Remco

    Why are you dropping and re-creating the materialized view in the first place? That's not something that should ever happen in a live system. You should just be refreshing the data in the materialized view, in which case the privileges & policies associated with the materialized view would be retained. It's no different than dropping and re-creating a table that has a policy associated with it-- you'd have to re-apply the policy after re-creating the table.
    Theoretically, I suppose you could create a DDL trigger that would throw an error if you tried to drop an object with an associated policy. Fixing your approach, though, so that you're not dropping & re-creating objects is going to be the better long-term solution.
    Justin

  • Query on Materialized view and materialized view log

    I am creating a materialized view something like this.but getting following error:
    ERROR at line 1:
    ORA-12032: cannot use rowid column from materialized view log on "SCOTT"."EMP"
    SQL> create snapshot log on scott.emp;
    Materialized view log created.
    SQL> create materialized view scott_emp refresh fast on demand as select deptno,sum(sal) sum_sal from scott.emp group by deptno;
    ERROR at line 1:
    ORA-12032: cannot use rowid column from materialized view log on "SCOTT"."EMP"
    Note when i have my query in materialized view as "select * from emp;" in place of
    "select deptno,sum(sal) sum_sal from scott.emp group by deptno;" This code works fine.
    How do i have a materialized with with a group by clause.
    Thanks in Advance

    Got the answer myself.
    I wasnt adding all the required columns.
    CREATE MATERIALIZED VIEW LOG ON scott.emp
    WITH SEQUENCE, ROWID (<all the required columns>)
    INCLUDING NEW VALUES;
    Anyways,
    Thanks guys...

  • I have an Ipad2, an Iphone 4 . I want to be able to sync both of these with my Windows desktop and Outlook 2007. I would like to sync to and from the Idevices and Outlook.

    I have an Ipad2, an Iphone 4 . I want to be able to sync both of these with my Windows desktop and Outlook 2007. I would like to sync to and from the Idevices and Outlook. When I attempt to sync in itunes I get a popup message asking if I want to delete, Merge or cancel. Not wanting to delete of cancel the only option left is Merge.
                When selecting Merge all of the entries in outlook are added to the idevice. The next time I merge all of the same entries plus any new ones are added, resulting in older entries being repeated i.e an entry like “John’s Birthday” will appear 5 or 6 times on the same date.
                How do I resolve this issue? How do I get the the sync process to add only new entries?

    This is a great question. First, facetime will not work because it has to establish a Call connection first. iMessage should work, but how to get it going I am not sure. Two great Apps to try are, Viber and Skype. Viber is excellent, it works over WiFi, you can make free calls and free text messages all over the world with other users who have Viber installed. It does not even have to be open on screen to work. Viber does have to recieve one text message with activation code, to activate it, this will be your only hurdle, but maybe Verizon can help you get that one text message. Skype does have to be open on screen however, but this can function like Facetime with WiFi connection. Definitely get Viber free in App Store, and put it on all your iDevices so the old Verizon iPhone can function as a telephone when on WiFi.

  • Materialized View and AND/OR

    I am really in need of some help as I am having trouble refreshing this materialized view. Basically the code below if triggered by executing the SQL manually will pull the correct records which is somewhere in the 970 unique record range.
    Having known that the SQL worked we created a materialized view that would refresh every day at 3 AM so that we could send this file to an external vendor. However the materialized view that references this SQL when it refreshes pulls in some 100,000 unique records incorrectly.
    After testing over and over I have identified that the refresh seems to be bypassing the "AND/OR" statment that I have setup to look at:
    (AND ((CURRENT_DATE - msp_loan_d.next_payment_due_date) >= 58 AND msp_property_d.property_alpha_state_code <> 'NC'
    OR ((CURRENT_DATE - msp_loan_d.next_payment_due_date) >= 45 AND msp_property_d.property_alpha_state_code = 'NC')).
    Any ideas on this one and maybe I need to rewrite the SQL? Not sure why the materialized view would interpret the SQL any differently.
    SELECT DISTINCT msp_loan_d.loan_number, TRUNC (CURRENT_DATE - msp_loan_d.next_payment_due_date ,0) AS DPD,
    TO_DATE (msp_user_defined_d.user_07_position_field_1a, 'MMDDYY') AS Demand_Date,
    MSP_BORROWER_D.MORTGAGOR_EXPANDED_FIRST_NAME,
    MSP_BORROWER_D.MORTGAGOR_EXPANDED_MIDDLE_NAME, MSP_BORROWER_D.MORTGAGOR_EXPANDED_LAST_NAME,
    MSP_BORROWER_D.CO_MRTGR_EXPANDED_FIRST_NAME, MSP_BORROWER_D.CO_MRTGR_EXPANDED_MIDDLE_NAME,
    MSP_BORROWER_D.CO_MRTGR_EXPANDED_LAST_NAME,
    MSP_BORROWER_D.BILLING_ADDRESS_LINE_4, MSP_BORROWER_D.BILLING_CITY_NAME,
    MSP_BORROWER_D.BILLING_STATE, MSP_BORROWER_D.BILLING_ZIP_CODE, MSP_PROPERTY_D.PROPERTY_STREET_ADDRESS, MSP_PROPERTY_D.CITY_NAME,
    MSP_PROPERTY_D.PROPERTY_ALPHA_STATE_CODE, MSP_PROPERTY_D.PROPERTY_ZIP_CODE, msp_loan_d.next_payment_due_date,
    CO.ADL_CO_BORR_UNFORMATTED_NAME_1 AS "ADDITIONAL COBORROWER",
    CO.ADL_CO_BORR_STREET, CO.ADL_CO_BORR_CITY, CO.ADL_CO_BORR_STATE, CO.ADL_CO_BORR_ZIP_CODE,
    MSP_LOAN_D.Investor_ID, msp_loan_d.first_principal_balance, msp_loan_d.last_full_payment_date, MSP_ORIGINAL_LOAN_D.ORIGINAL_MORTGAGE_AMOUNT,
    MSP_LOAN_D.TOTAL_MONTHLY_PAYMENT, MSP_DELINQUENCY_D.DELINQUENT_PAYMENT_COUNT, MSP_DELINQUENCY_D.DELINQUENT_PAYMENT_BALANCE,
    MSP_LOAN_D.ACCRUED_LATE_CHARGE_AMOUNT, MSP_LOAN_D.NSF_FEE_BALANCE, MSP_CORPORATE_ACCOUNTING_D.RECOVER_CORP_ADVANCE_BALANCE,
    MSP_LOAN_D.SUSPENSE_BALANCE, MSP_ORIGINAL_LOAN_D.NOTE_DATE As "ORIGINATION DATE", MSP_LOAN_D.LOAN_TERM AS "LOAN TERM",
    add_months(msp_loan_d.next_payment_due_date,-1) AS "DUE DATE OF LAST PAYMENT", MSP_USER_DEFINED_D.USER_20_POSITION_FIELD_2A AS "ORIGINATOR",
    NJCLERK.payee_address_line_1, NJCLERK.payee_address_line_2, NJCLERK.payee_address_line_3,
    NJCLERK.payee_address_line_4, NJCLERK.payee_address_zip_code
    FROM me589mgr.msp_loan_d@infodb,
    me589mgr.msp_property_d@infodb,
    me589mgr.msp_user_defined_d@infodb,
    me589mgr.msp_borrower_d@infodb,
    ME589MGR.MSP_ORIGINAL_LOAN_D@infodb,
    ME589MGR.MSP_DELINQUENCY_D@infodb,
    ME589MGR.MSP_CORPORATE_ACCOUNTING_D@infodb,
    (SELECT DISTINCT LOAN_NUMBER, Hi_TYPE, LO_TYPE
    FROM ME589MGR.MSP_LOAN_D@infodb
    WHERE HI_TYPE = 3
    AND LO_TYPE = 8) UNSECURED,
    (SELECT DISTINCT msp_bankruptcy_d.loan_number
    From ME589MGR.MSP_BANKRUPTCY_D@infodb
    Where BKR_STATUS_CODE = 'A') BKLOAN,
    (SELECT DISTINCT MSP_ADDITIONAL_CO_BORROWER_D.LOAN_NUMBER,
    ADL_CO_BORR_UNFORMATTED_NAME_1, ADL_CO_BORR_STREET, ADL_CO_BORR_CITY,
    ADL_CO_BORR_STATE, ADL_CO_BORR_ZIP_CODE
    FROM ME589MGR.MSP_ADDITIONAL_CO_BORROWER_D@infodb
    WHERE ADL_CO_BORR_THIRD_PARTY_FLAG = 'N'
    AND ADL_CO_BORR_SEQUENCE = '1') CO,
    (SELECT
    msp_tax_d.loan_number,
    msp_payee_d.payee_address_line_1, msp_payee_d.payee_address_line_2,
    msp_payee_d.payee_address_line_3, msp_payee_d.payee_address_line_4,
    msp_payee_d.payee_address_zip_code,
    ROW_NUMBER() OVER (PARTITION BY msp_tax_d.loan_number ORDER BY msp_tax_d.tax_key_sequence_number DESC) AS ROW_ORDER
    FROM me589mgr.msp_tax_d@infodb,
    me589mgr.msp_payee_d@infodb,
    me589mgr.msp_property_d@infodb
    WHERE msp_tax_d.tax_key_sequence_number = 1
    AND msp_tax_d.tax_payee_code = msp_payee_d.payee_id
    AND msp_property_d.property_alpha_state_code = 'NJ'
    AND msp_tax_d.loan_number = msp_property_d.loan_number) NJCLERK
    WHERE ( msp_loan_d.loan_number = UNSECURED.LOAN_NUMBER (+)
    AND UNSECURED.LOAN_NUMBER IS NULL
    AND msp_loan_d.loan_number = BKLOAN.LOAN_NUMBER (+)
    AND BKLOAN.LOAN_NUMBER IS NULL
    AND msp_loan_d.loan_number = MSP_ORIGINAL_LOAN_D.LOAN_NUMBER (+)
    AND msp_loan_d.loan_number = MSP_DELINQUENCY_D.LOAN_NUMBER (+)
    AND msp_loan_d.loan_number = MSP_CORPORATE_ACCOUNTING_D.LOAN_NUMBER (+)
    AND msp_loan_d.loan_number = msp_user_defined_d.loan_number (+)
    AND msp_loan_d.loan_number = msp_property_d.loan_number (+)
    AND msp_loan_d.loan_number = msp_borrower_d.loan_number (+)
    AND msp_loan_d.loan_number = CO.LOAN_NUMBER (+))
    AND ((CURRENT_DATE - msp_loan_d.next_payment_due_date) >= 58 AND msp_property_d.property_alpha_state_code <> 'NC'
    OR ((CURRENT_DATE - msp_loan_d.next_payment_due_date) >= 45 AND msp_property_d.property_alpha_state_code = 'NC'))
    AND (msp_loan_d.first_principal_balance > 0
    AND msp_loan_d.man_code NOT IN ('U' , 'D', 'Y' ,'B', 'F', 'L', 'G', 'I','M', 'O', 'R', 'X', 'Y', 'W', 'T', 'Q', 'Z')
    AND msp_property_d.property_alpha_state_code NOT IN ('WA','NM','MA','MD','NY','PA')
    AND msp_loan_d.loan_number = NJCLERK.LOAN_NUMBER (+)
    AND msp_loan_d.PROCESS_STOP_CODE NOT IN ('1', '2', '8', 'A', 'B', 'C', 'D', 'E', 'F', 'H', 'J', 'R', '9', 'K', 'O', 'U', 'V', 'X'))
    AND (msp_loan_d.last_full_payment_date >= TO_DATE (msp_user_defined_d.user_07_position_field_1a, 'MMDDYY')
    OR (msp_user_defined_d.user_07_position_field_1a IS NULL))

    Hi,
    I don't think AND/OR has anything to do with your problem. The issue seems to be how to write outer joins.
    You have an outer join to msp_user_defined_d:
    AND msp_loan_d.loan_number = msp_user_defined_d.loan_number(+)But here you have an inner join to same table:
    AND (     msp_loan_d.last_full_payment_date >= TO_DATE (msp_user_defined_d.user_07_position_field_1a, 'MMDDYY')
           OR (msp_user_defined_d.user_07_position_field_1a IS NULL)
        )It looks like you need to change this into:
    (If you hit ORA-01719: outer join operator {noformat}(+){noformat} not allowed in operand of OR or IN , you may have to rewrite accordingly)
    AND (     msp_loan_d.last_full_payment_date >= TO_DATE (msp_user_defined_d.user_07_position_field_1a(+), 'MMDDYY')
           OR (msp_user_defined_d.user_07_position_field_1a IS NULL)
        )If true, it makes me wonder. Did you test your query alone, did it produce the correct resultset?
    Regards
    Peter

  • Materialized View and Indexing

    I have the following Materialized view based on the join of 2 tables merchant and address.
    Name Null? Type
    FIRST_NAME VARCHAR2(15)
    MEMBER_DATE DATE
    DBA_NAME VARCHAR2(15)
    LEGAL_NAME VARCHAR2(15)
    STREET VARCHAR2(50)
    CITY VARCHAR2(25)
    STATE VARCHAR2(2)
    PHONE NUMBER
    Then I create the preference as below
    BEGIN
    CTX_DDL.CREATE_PREFERENCE ('my_pref', 'MULTI_COLUMN_DATASTORE');
    CTX_DDL.SET_ATTRIBUTE ('my_pref', 'COLUMNS', 'first_name, member_date, dba_name, legal_name, street, city, state, phone');
    END;
    When I create an index on the above view, I specify the First_name as the column on which the index is based.
    This is fine if I have search queries based on First_name.
    But the moment I use the contains query to search on any other column name e.g: Legal_name, Oracle text gives an error saying the column is not indexed.
    When we have such a scenario where any column of the view can be searched, how do you create the index? Can we specify multiple columns when creating the index? If not, then how do we solve this problem?

    Hi,
    You still keep the indexed column name in the WHERE clause, but can search for anything in any of the columns. Example using the HR sample schema:
    BEGIN
    CTX_DDL.CREATE_PREFERENCE ('my_pref', 'MULTI_COLUMN_DATASTORE');
    CTX_DDL.SET_ATTRIBUTE ('my_pref', 'COLUMNS', 'FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,SALARY');
    END;
    CREATE INDEX EMPLOYEE_IDX ON EMPLOYEES(FIRST_NAME)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('DATASTORE MY_PREF');
    -- Searching on first name works
    SELECT SCORE(1), FIRST_NAME, LAST_NAME, PHONE_NUMBER, SALARY
    FROM EMPLOYEES
    WHERE CONTAINS(FIRST_NAME, 'JENNIFER', 1) > 0;
    SCORE(1) FIRST_NAME LAST_NAME PHONE_NUMBER
    SALARY
    8 Jennifer Dilly 650.505.2876
    3600
    8 Jennifer Whalen 515.123.4444
    4400
    -- Searching for last name, but keeping the indexed column name in the WHERE clause
    SELECT SCORE(1), FIRST_NAME, LAST_NAME, PHONE_NUMBER, SALARY
    FROM EMPLOYEES
    WHERE CONTAINS(FIRST_NAME, 'whalen', 1) > 0;
    SCORE(1) FIRST_NAME LAST_NAME PHONE_NUMBER
    SALARY
    9 Jennifer Whalen 515.123.4444
    4400
    -- A search for a salary
    SELECT SCORE(1), FIRST_NAME, LAST_NAME, PHONE_NUMBER, SALARY
    FROM EMPLOYEES
    WHERE CONTAINS(FIRST_NAME, '3600', 1) > 0;
    SCORE(1) FIRST_NAME LAST_NAME PHONE_NUMBER
    SALARY
    8 Jennifer Dilly 650.505.2876
    3600
    8 Renske Ladwig 650.121.1234
    3600
    Thanks,
    Ron

  • Creation of Materialized view and Materialized view log.

    I wanted to create materialized view with 'REFRESH FAST ON COMMIT' option.
    1) Table1 --it is partitioned range + list -- Added primary key
    2) view1   -- having primary keys on view's base table
    Steps:
    1) create materialized view log on Table1 ; -- default primary key
    2) create materialized view log on view1.  --- It is giving below error.
    ORA-00942: table or view does not exist
    i wanted to create Materialized view like below
    create materialized view
    REFRESH fast ON commit
    as
    select ...
    ... from table1
    where c1 in (select c1 from view1 where ... );
    Question:
    1) As i am getting above error while creating MV log on view. Can we create MV log on view or we have to create MV log on view base table?
    2) To create MV with ''REFRESH FAST ON COMMIT' option , do we need to have primary key on master tables? 
    Any pointers on this will really helpful.
    Thanks
    Prasad

    Also created MV LOG on 3 tables and tried with joins ..
    create materialized view
    REFRESH fast ON commit
    as
    select ...
    ... from table1 , tab2 t2,tab3 t3
    where ....
    and ...
    Get same error ORA-12052: cannot fast refresh materialized view AVSYS.EVENT_LOG_MV
    2052. 00000 -  "cannot fast refresh materialized view %s.%s"
    *Cause:    Either ROWIDs of certain tables were missing in the definition or
               the inner table of an outer join did not have UNIQUE constraints on
               join columns.
    *Action:   Specify the FORCE or COMPLETE option. If this error is got
               during creation, the materialized view definition may have be
               changed. Refer to the documentation on materialized views.

Maybe you are looking for

  • I can't burn a dvd....Help!!!!!

    Hi everyone. I've been trying to burn a dvd, but I get an error message that says the dvd is corrupt and it might not play. When I try playing nothing happens. has this happened to anyone here???

  • My desktop doesn't fit on my screen

    My desktop and any software screens will not fit on my MacBook computer monitor anymore. Mousing to the edges of the screen will cause it to slide into view while the other edges slide out of view. I've tried changing to different screen resolutions

  • Recognize sysdate stored in database?

    Hi: How to recognize sysdate+10_ literally stored in the database to have the actual meaning? Saad

  • How to create spfile in oracle 10g

    hi everyone, i had this problem while i was creating a new database in oracle 10g.when running the database script, it gives an error about invalid option for create temporary tablespace. is it necessary to have an spfile created in 10g. when the scr

  • Invoice to 3rd Party System

    Dear Experts, I am trying to send customer invoice to an external system via PI with IDoc type INVOIC02. I have done the basic setting for the output type ZRD0 to transfer the document via. EDI. I have created a partner profile for Logical System u20