ORA-12032: cannot use rowid column

Hi,
on 8.1.7 I have the following error :
ORA-12032: cannot use rowid column from materialized view log on "string"."string"
The solution is :
Action: A complete refresh is required before the next fast refresh. Add ROWID columns to the materialized view log, if required.
How can I do a complete refresh before the next fast refresh or Add ROWID columns ? How to know if Add ROWID columns is required ?
Thank you.
PS :
my script is :
START WITH TO_DATE('06-jul-2010 17:57:48','dd-mon-yyyy hh24:mi:ss')
NEXT SYSDATE+1/24

user522961 wrote:
Hi,
on 8.1.7 I have the following error :
ORA-12032: cannot use rowid column from materialized view log on "string"."string"
The solution is :
Action: A complete refresh is required before the next fast refresh. Add ROWID columns to the materialized view log, if required.
How can I do a complete refresh before the next fast refresh or Add ROWID columns ? How to know if Add ROWID columns is required ?
Thank you.run above
EXECUTE DBMS_MVIEW.REFRESH('MV_NAME','C');

Similar Messages

  • Materialized View cannot use filter columns ORA-12033

    Hello Forum members,
    I am creating the following MV with Can you please advise me??
    Thanks
    SQL> create materialized view log on his_swi with rowid including new values;
    Materialized view log created.
    SQL>
    SQL> CREATE MATERIALIZED VIEW His_Swi_mv
    2 refresh fast with rowid
    3 AS
    4 select quarter,sum(sw_po),sum(sw_po_fre),
    5 sum(sw_por_sta+sw_porunt_swi+sw_por_hb+sw_po_free) as proj from
    6 history_switch group by quarter;
    his_swi group by quarter
    ERROR at line 6:
    ORA-12033: cannot use filter columns from materialized view log on
    "EM"."HIS_SWI"

    Hello Forum members,
    Please ignore the above post.
    got solution from : http://www.jusungyang.com/DWfolder/MaterializedViews/MVlogFilterColumns.txt
    Thanks

  • ORA-01445: cannot select ROWID from, or sample, a join view without a key-p

    Hi All,
    I am facing issue with one sql query. It is giving me error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    I am not getting any clue to solve this. On internet, i didn't find proper reason for this error and troubleshooting way and solution for this error. Everywhere i saw one sentence, "Key preserved means the row from the base table will appear AT MOST ONCE in the output view on that table" but it didn't solve my problem.
    I have 1099 columns in one select query. so avoiding the actual column list in select clause. Instead I am trying to select ROWIDs from all tables in join. My understanding is ROWID is a unique identifier in table not in database. But though I remove ROWIDs, I get same error. So please don't bother about these ROWIDs.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,DIM_SEC.ROWID AS ABC3
    ,DIM_SEC_ADJ.ROWID AS ABC4
    ,DIS_CAT.ROWID AS ABC5
    ,CTRY.ROWID AS ABC6
    ,BCP.ROWID AS ABC7
    ,STAGE.ROWID AS ABC8
    FROM FACT_POSITION FACT
    LEFT JOIN FACT_POSITION_ADJ FACT_ADJ ON FACT.POSITION_PKID = FACT_ADJ.POSITION_FKID
    LEFT JOIN DIM_SOURCE_SYSTEM SOURCE ON FACT.SOURCE_SYSTEM_FKID = SOURCE.SOURCE_SYSTEM_PKID
    LEFT JOIN DIM_SECURITY DIM_SEC ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC.SECURITY_PKID
    LEFT JOIN DIM_SECURITY_ADJ DIM_SEC_ADJ ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC_ADJ.SECURITY_PKID
    LEFT JOIN DIM_DISCLOSURE_CATEGORY DIS_CAT ON FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    LEFT JOIN COUNTRY_REFERENCE CTRY ON CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    LEFT JOIN BUSINESS_CLOSE_PERIOD BCP
    ON BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_LOCKED='Y' AND BCP.IS_ACTIVE='Y'
    LEFT JOIN GUI_STAGING STAGE ON
    FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5)
    WHERE FACT.POSITION_PKID=64524374;
    While trying to sort this error, I found interesting things that made me more confused.
    if I remove TO_DATE function from select clause, same join query works.
    If I remove any table from join and keep TO_DATE function in select clause, query works.
    That tells, there is no problem in query.
    Then please anyone help me to sort out the error. FYI. I have googled a lot for this error. but didn't get solution/clue. That is why I am posting this problem to forum.
    Thanks in advance. waiting for reply ASAP.
    Pravin Pujari
    [email protected]

    I think i got the solution. The syntax i was using (ANSI syntax) doesn't work in the oracle database version i am using.
    When i updated my query with older oracle syntax, it worked.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,SOURCE.ROWID AS ABC3
    ,DIM_SEC.ROWID AS ABC4
    ,DIM_SEC_ADJ.ROWID AS ABC5
    ,DIS_CAT.ROWID AS ABC6
    ,CTRY.ROWID AS ABC7
    ,BCP.ROWID AS ABC8
    ,STAGE.ROWID AS ABC8
    FROM [email protected] FACT
    ,[email protected] FACT_ADJ
    ,[email protected] SOURCE
    ,[email protected] DIM_SEC
    , [email protected] DIM_SEC_ADJ
    , [email protected] DIS_CAT
    , GUI.COUNTRY_REFERENCE CTRY
    , GUI.BUSINESS_CLOSE_PERIOD BCP
    , GUI.GUI_STAGING STAGE
    WHERE FACT.POSITION_PKID=64517140
    AND FACT_ADJ.POSITION_FKID(+) = FACT.POSITION_PKID
    AND SOURCE.SOURCE_SYSTEM_PKID=FACT.SOURCE_SYSTEM_FKID
    AND DIM_SEC.SECURITY_PKID=FACT.SUBSYS_SECURITY_FKID
    AND DIM_SEC_ADJ.SECURITY_PKID(+)=DIM_SEC.SECURITY_PKID
    AND FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    AND CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    AND BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_ACTIVE='Y'
    AND FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5);

  • V4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,

    Hi
    I'm creating a tabular form in version 4.0.
    The select is based on three tables all of which have primary keys, and the keys are selected, but every time I run the page I get the following error:-
    failed to parse SQL query:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    The query runs just fine in TOAD
    Any ideas?
    Thanks
    Mike
    select
    PRL.PERF_RATING_LINE_ID,
    PRL.PERF_RATING_LINE_ID PERF_RATING_LINE_ID_DISPLAY,
    PRL.BUSINESS_UNIT,
    PRL.EMPLID,
    ''''||PRL.REVIEW_YEAR REVIEW_YEAR,
    PRL.REVIEW_PERIOD,
    PRL.PERFORMANCE_SCORE,
    PRL.MODERATED_SCORE,
    PRL.HRM,
    PRL.COMMENTS,
    PBR.BU_DESC,
    ''''||PBR.DEPTID DEPTID,
    PBR.DEPT_DESC,
    PBR.EMPLOYEE_NAME,
    PBR.GRADE,
    PRL.SCORE_APPROVED_BY,
    PBR.TEMP_PERM,
    PBR.GENDER,
    PBR.JOB_START_DATE,
    decode(DECODE(SUBSTR(PBR.FLAG,1,5),'Job s',substr(PBR.FLAG,instr(PBR.FLAG,'~',1)+2,3)),
    'HIR','Hired','XFR','Transfer','REH','Rehire')||
    decode(SUBSTR(PBR.FLAG,1,30),'Job starts during period ~ XFR',' - '||substr(PBR.FLAG,instr(PBR.FLAG,'~',1,2)+2)) JOB_START_DETAILS,
    PBR.APPOINTMENT_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,2)+2) JOB_END_DATE,
    SUBSTR(PBR.JOB_END_DETAILS,INSTR(PBR.JOB_END_DETAILS,'~',1,1)+2,INSTR(PBR.JOB_END_DETAILS,'~',1,2)-INSTR(PBR.JOB_END_DETAILS,'~',1,1)-2) REASON,
    PBR.JOB_GROUP,
    PBR.JOB_GROUP_DESC,
    PBR.JOBCODE,
    PBR.JOBCODE_DESC JOB_DESC,
    PBR.JOB_FAMILY,
    PBR.JOB_FAMILY_DESC,
    PBR.PBR_ID,
    MD.MGR_DEPT_ID
    from PERFORMANCE_BASE_REFRESH_V PBR,
    PERFORMANCE_RATING_LINE PRL,
    Y00_OPR_MGR_DEPT MD
    WHERE (PRL.BUSINESS_UNIT = PBR.BUSINESS_UNIT
    AND PRL.EMPLID = PBR.EMPLID
    AND PRL.REVIEW_YEAR = PBR.REVIEW_YEAR
    AND PRL.REVIEW_PERIOD = PBR.REVIEW_PERIOD)
    AND MD.OPRID = :APP_USER
    AND INSTR(':'||MD.DEPTS_MANAGED||':',':'||PBR.DEPTID||':') > 0
    AND MD.MGR_DEPT_ID > 0
    AND PBR.ADMIN_CENTRE IN
    (select c.deptid AC
    from [email protected] A,
    [email protected] C
    where A.ROWSECCLASS = C.ROWSECCLASS
    AND C.DEPTID != 'ZZZZ'
    and a.oprid = :APP_USER)
    AND (:P2210_BUSINESS_UNIT IS NULL
    OR PBR.BUSINESS_UNIT = :P2210_BUSINESS_UNIT)
    AND (:P2210_EMPLOYEE_NAME IS NULL
    OR INSTR(UPPER(PBR.EMPLOYEE_NAME),UPPER(:P2210_EMPLOYEE_NAME)) > 0)
    AND (:P2210_DEPARTMENT IS NULL
    OR PBR.DEPTID = :P2210_DEPARTMENT)
    AND (:P2210_PERFORMANCE_RATING IS NULL
    OR PBR.PERFORMANCE_SCORE = :P2210_PERFORMANCE_RATING)
    AND (:P2210_MODERATED_RATING IS NULL
    OR PBR.MODERATED_SCORE = :P2210_MODERATED_RATING)
    AND (:P2210_GRADE IS NULL
    OR PBR.GRADE = :P2210_GRADE)
    AND (:P2210_PERM_TEMP IS NULL
    OR PBR.TEMP_PERM = :P2210_PERM_TEMP)
    AND SUBSTR(NVL(PBR.JOB_END_DETAILS,'XXX'),1,3) NOT IN ('TER','TOC')
    AND PRL.SCORE_APPROVED_BY IS NULL

    Hi Marc,
    Thanks again for the quick reply and all the support the dev team is providing to us.
    Couple of question finally on this issue:
    - fixing the "copy page"/"copy validation" bug, our workaround - by making a page copy - we've found to use the standard validation on tabular form based on complex views will go away, right?
    - I made a sql trace when running the originally created tabular form page and I found the statement generated by the apex engine which gives the ORA-01446. Just wondering, would it be possible that apex is using the PK defined during the wizard instead of the rowid?
    - If not, would it be a possible enhancement request in the future to let the developer name the ROWID column optionally, and then apex will use that column as rowid instead of the ROWID? This can give flexibility for us as developers, in this case complex views (with instead of triggers) can be standard way supported. What I mean exactly is to create the above view in the testcase as follows (most of these cases there is always a base table in the view, and the rest of the tables are used as lookups, so I can pick up the desired ROWID in the view with an alias):
    CREATE OR REPLACE VIEW  CUSTOMER_ORDERS_V  AS
      SELECT cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                COUNT (ord.order_id) order_count,
                CUS.ROWID ROW_ID
           FROM demo_customers cus, demo_orders ord
          WHERE ord.customer_id(+) = cus.customer_id
       GROUP BY cus.customer_id,
                cus.cust_last_name,
                cust_first_name,
                cus.cust_city,
                CUS.ROWID;and then at design time, I could pick up the ROW_ID column as rowid, so all the rest of the functionality could work as working now on simple views and tables.
    What do you think on that?
    best regards,
    Peter

  • Tabular form on a view :ORA-01446: cannot select ROWID from, or sample...

    Hi,
    I have two tables
    CUSTOMERS
    ===========
    Name Null Type
    ======================
    CUST_UID NOT NULL NUMBER(4)
    CUST_NAME VARCHAR2(50)
    ITEM_PRICES
    ===========
    Name Null Type
    ======================
    IP_UID NOT NULL NUMBER(4)
    IP_ITEM_DESC VARCHAR2(50
    IP_COST_PRICE NUMBER(6,2)
    IP_SELL_PRICE NUMBER(6,2)
    I have a view IPS_VW which is the cartician product of CUSTOMERS and ITEM_PRICES, and an instead of trigger for UPDATE on this view which either inserts or updates data in the following third table
    ITEM_PRICES_SPECIAL
    ===========
    Name Null Type
    ======================
    IPS_UID NOT NULL NUMBER(4)
    CUST_UID NUMBER(4)
    IP_UID NUMBER(4)
    IPS_SELL_PRICE NUMBER(6,2)
    The following is my view
    SELECT 'A'||ROWNUM AS "IPSVW_UID",
    0 AS "IPSVW_IPS_UID",
    "CUSTOMERS"."CUST_UID" AS "IPSVW_CUST_UID",
    "ITEM_PRICES"."IP_UID" AS "IPSVW_IP_UID",
    "ITEM_PRICES"."IP_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
    FROM "CUSTOMERS" "CUSTOMERS",
    "ITEM_PRICES" "ITEM_PRICES"
    WHERE NOT EXISTS
    (SELECT 1
    FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL"
    WHERE "ITEM_PRICES_SPECIAL"."IP_UID" ="ITEM_PRICES"."IP_UID"
    AND "ITEM_PRICES_SPECIAL"."CUST_UID" ="CUSTOMERS"."CUST_UID"
    UNION
    SELECT 'B' ||ROWNUM AS "IPSVW_UID",
    "ITEM_PRICES_SPECIAL"."IPS_UID" AS "IPSVW_IPS_UID",
    "ITEM_PRICES_SPECIAL"."CUST_UID" AS "IPSVW_CUST_UID",
    "ITEM_PRICES_SPECIAL"."IP_UID" AS "IPSVW_IP_UID",
    "ITEM_PRICES_SPECIAL"."IPS_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
    FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL";
    And this is the instead of trigger
    CREATE OR REPLACE TRIGGER "TRG_IPSVW_UPDATE" INSTEAD OF
    UPDATE ON IPS_VW REFERENCING NEW AS N FOR EACH ROW
    BEGIN
    IF :N.IPSVW_IPS_UID = 0 THEN
    INSERT INTO ITEM_PRICES_SPECIAL
    ( CUST_UID, IP_UID,IPS_SELL_PRICE )
    VALUES
    ( :N.IPSVW_CUST_UID,:N.IPSVW_IP_UID, :N.IPSVW_IPS_SELL_PRICE );
    ELSE
    UPDATE ITEM_PRICES_SPECIAL
    SET IPS_SELL_PRICE = :N.IPSVW_IPS_SELL_PRICE
    WHERE IPS_UID = :N.IPSVW_IPS_UID;
    END IF;
    END;
    Everything works fine in SQLPLUS, if i update a rate in this view, a record is either inserted or updated in the third table.
    But when i try to create a tabular form based on this view, i get the error
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    Could someone help me please?
    Thanks,
    Allen

    I think The tabular form needs to be able to identify some primary key and using a rownum concatenation cannot provide that.
    Cheers
    Kofi

  • What causes "ORA-01445: cannot select ROWID from" error

    While executing a SELECT query i got this error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a
    key-preserved table
    Below mentioned is the join condition part of the query. The line which the error has occured is italicized
    from checkout_hdtl ch
    inner join pmt_htl ph on ph.post_ln_a = ch.post_ln_code
    inner join pin_dls pd on pd.post_ln_a = ph.post_ln_code
    inner join carton_dtl cd on cd.carton_nbr = ch.carton_nbr
    and cd.lseq_nbr = pd.lseq_nbr
    inner join invoice_module im on cd.invevt_code = im.inv_code
    inner join item_dock_master del on nm.invent_code = iwm.inv_code
    left outer join inv_curr_comm_code mnb on ium.invent_code = im.inv_code
    and icc.cntry = ph.shipto_cntry
    left outer join vw_ver_master vw on vw.del_rec = ch.del_rec
    left outer join cmd code_entry on code_pi.cntry =
    cd.code_entry where ch.shpmt_nbr = '3'
    What do i do?

    I would rather use Notepad than store my data in SQL server. It just so happens that our product is released for SQL Server as well. Hence i did the testing.
    >Is there a limit to the number of joins that can be performed in Oracle?
    Wrong question as it does not have anything to do with the number of views.. it has everything to do with the ability to correctly identify the unique row. Re-read the error message details posted by Blu - it explains the error.As you can see from my post, i created a table using the(CTAS) SELECT query from the View vw_ver_master's definition. So the view's result set is now stored in a table and now there are only tables involved in these JOINS.
    The query will succeed if i comment out ANY one of these JOINS in this statement. This is so weird.
    I

  • Problem in updating fa_additions SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table

    Hi,
    After using sql loader to import informations in the table fa_mass_additions and after the functionnal uses a treatment to imputate this assets, it asks me to do an update on the table fa_additions to change the value of attribute1 but i get an error
    Error report:
    ORA-01779: cannot modify a column which maps to a non key-preserved table
    ORA-06512: at line 11
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which
               map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    please how can i do this update?

    Hi,
    The "fa_additions" is a view, not a table.
    You should update the base table "fa_additions_b".
    Regards,
    Bashar

  • SQL Developer 3.1 EA3:   ORA-01446: cannot select ROWID . . .

    I'm running into a problem in 3.1 EA3 that I did not see in 3.0 (Oracle IDE     3.0.04.34). Both Installations are 64 bit using 64 bit Java under Windows 7 x64 SP1.
    When from either the "Connections" or "Schema" window I open some views and select the "Data" tab I the following messages:
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    ORA-02063: preceding line from HSDEVL
    twice. Other views give:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    ORA-02063: preceding line from HSDEVL
    All views that show the error retrieve the data via a dblink to another oracle instance, although not all views using the dblink show an error.
    Has anyone else seen this change? Is there anything I can do to get it fixed.
    Thanks.
    Tom True
    P

    I'm having the same issue. The issues seems to also exist in the newly release 3.1.
    Yes it seems to be related to the instead of trigger.
    Is this a known bug?
    Here is a testcase to reproduce the issue.
    create table mytab as select * from tab;
    create table myobjects as select * from user_objects;
    create or replace view test_view as
    select myobjects.object_id, mytab.tname, mytab.tabtype from mytab, myobjects where mytab.tname=myobjects.object_name group by myobjects.object_id, mytab.tname, mytab.tabtype;
    create or replace trigger io_test_view_trg
    INSTEAD OF INSERT or UPDATE or DELETE
    ON test_view
    FOR EACH ROW
    begin
    if updating then
    update mytab set tname=:NEW.tname, TABTYPE=:NEW.TABTYPE where tname=:OLD.tname;
    update myobjects set object_name=:NEW.tname where object_name=:OLD.tname;
    end if;
    end;
    show errors
    -- TEST
    select * from test_view;
    update test_view set tname='1TEST_TABLE' where rownum < 2;
    -- Attempting to view TEST_VIEW from SQL Developper fails with
    -- ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    -- CLEANUP
    drop table mytab;
    drop table myobjects;
    drop view test_view;
    ----

  • ORA-02348: cannot create VARRAY column with embedded LOB

    Hi
    This error message I get when I try to create a table from my schema file which has a (sub-) element of type CLOB.
    In my XML document I have an element which needs to become declared a CLOB (because it's > 4000 bytes), in my Schema I define it's element node like:
    <xs:element name="MocovuState" xdb:SQLType="CLOB">
    I can register this Schema file but when I create the table, I get the error:
    ORA-02348: cannot create VARRAY column with embedded LOB
    Does anybody know how to handle this ?
    Marcel

    You need to use the xdb:storeVarrayAsTable="true" schema annotation so that unbounded elements are created at schema registration time as nested tables. Varrays can not contain CLOBs/BLOBS. Use the schema annotation xdb:SQLType="CLOB" to tell Oracle XMLDB to use CLOB storage for the element. See your schema below:
    P.S. XMLSPY is invaluable as it supports Oracle XML Schema annotations.
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="http://www.yourregisteredschemanamespace.com" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
         <xs:element name="nRootNode">
              <xs:complexType>
                   <xs:all>
                        <xs:element name="nID" type="xs:long"/>
                        <xs:element name="nStringGroup" type="nStringGroup" minOccurs="0"/>
                   </xs:all>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="nStringGroup">
              <xs:sequence>
                   <xs:element name="nString" type="nString" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="nString" xdb:SQLType="CLOB">
              <xs:sequence>
                   <xs:element name="nValue" type="nValue" minOccurs="0" xdb:SQLType="CLOB"/>
              </xs:sequence>
              <xs:attribute name="id" type="xs:long" use="required"/>
         </xs:complexType>
         <xs:simpleType name="nValue">
              <xs:restriction base="xs:string">
                   <xs:minLength value="1"/>
              </xs:restriction>
         </xs:simpleType>
    </xs:schema>

  • ORA-01779: cannot modify a column which maps to a non key-preserved table

    define cusname='GEORGE';
    INSERT INTO (select s.prd_id, s.cus_id, s.qty_sold, s.price from sales s, customers c where s.cus_id=c.cus_id)
    VALUES (102,(select cus_id from customers where upper(c_name) like '%GEORGE%'),14,(select price from product where prd_id = 102)*14)
    I am getting the following error when I am trying to run the above query.
    SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    CUSTOMERS TABLE
    Name   
    Null   
    Type        
    CUS_ID 
    NOT NULL
    NUMBER      
    C_NAME         
    VARCHAR2(50)
    C_LIMIT         
    NUMBER      
    CITY           
    VARCHAR2(20)
    PRODUCT TABLE
    Name 
    Null   
    Type        
    PRD_ID
    NOT NULL
    NUMBER      
    PRICE         
    NUMBER      
    COST           
    NUMBER      
    SALES TABLE
    Name   
    Null   
    Type  
    PRD_ID 
    NOT NULL
    NUMBER
    CUS_ID 
    NOT NULL
    NUMBER
    QTY_SOLD         
    NUMBER
    PRICE             
    NUMBER

    Hi,
    As the error message sugggested, INSERT directly into the sales table.  You can get the values from a sub-query that joins whatever tables are needed, including sales itself.  MERGE might be simpler and more efficient than INSERT.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • " ORA-01445: cannot select ROWID from, or sample, a join view without a key

    GREETINGS !
    CREATED TABULAR FORM WITH QUERY
    WHILE EXECUTE ON SQL COMMANDS ITS EXECUTES AND SHOWS RECORDS, PASTE SAME QUERY ON TABULAR FORM SOURCE . WHEN RUN PAGE IT GIVES ERROR
    " ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table".
    Edited by: Omzz on Oct 3, 2012 10:34 PM

    When setting the tabular form, only use the table that you are trying to update/modify.
    After that is working, modify the SQL source with the other tables.
    By just pasting an SQL query into the region source, it doesnt know what tables you are trying to update
    PS - Please turn off "Caps Lock" :-)

  • Ora-01445 cannot select rowid from or sample a join view ?

    Hi All
    I get this error , while creating VO
    "ora-01445 cannot select rowid from or sample a join view without a key-preserved table"
    I created an EO, my table doesnt have primary key and it EO by deafualt created ROWID as primary key
    When i create VO, using the following query by joining fnd_flex_values , then i see this ORA error
    SELECT xxg2sourceacctneweo.elimination_sob_id, xxg2sourceacctneweo.ROWID
    FROM xxg2_elim_source_accts xxg2sourceacctneweo, fnd_flex_values fvs WHERE fvs.flex_value = xxg2sourceacctneweo.source_acct_value
    but I was able to get the results in TOAD, with out any issue.
    as a part of testing , if i change the query to join to fnd_user , it works fine
    SELECT XXG2SourceAcctNewEO.ELIMINATION_SOB_ID,
    XXG2SourceAcctNewEO.ROWID FROM xxg2_elim_source_accts XXG2SourceAcctNewEO,fnd_user fc where fc.user_id=XXG2SourceAcctNewEO.created_by
    Any suggestions?
    Thanks
    Ravi
    Edited by: rashmrs on Oct 6, 2009 9:47 PM

    Ravi,
    Please mark some attributes as PRimary Key in your VO. Then the system would not automatically generate the ROWID. You can remove this View attribute using the VO wizard.
    Regards
    Sumit

  • ORA-01445 : cannot select rowid from a join view without a key preserved ta

    Hi,
    I am using Designer6i for generatin forms:
    my blokc is based on a view...
    when executing the module, I have the following error when trying to change a value of an item :
    FRM 40501: unabe to reserve record for update or delete ,
    the display error say :
    ORA-01445 : cannot select rowid from a join view without a key preserved table!!!!!
    Any help please ???

    you either create an INSTEAD OF trigger for that view or use on-lock trigger on that block to edit, e.g., SELECT ...INTO...FROM...WHERE...FOR UPDATE NOWAIT.

  • ORA-01445: cannot select ROWID from a join view without a key-preserved tab

    Hi All,
    I have 2 windows in a form. When i click on a button in first window, then 2nd window will be opened. (Note: both windows are based have master-details relationship with Table1 and Table2 respectively)
    When i enter the information in 2nd window and click the SAVE Button it has to save those values to database. It used to work fine earlier. now, i am getting the following error.
    FRM-40501: ORACLE error: unable to reserve record for update or delete.
    ORA-01445: cannot select ROWID from a join view without a key-preserved table
    Please help me, how can i resolve this error. Also, guide me what is a key-preserved table.
    Thanks in advance,
    Amar

    Firstly: - Please make sure that you have not opened the same record somewhere else in any other form and trying to update from there.
    Secondly: - In your window 1 have you opened the same record which you are querying, editing and saving in window 2 ? If yes then this will givbe you error as you are trying to update a record which is already being updated somewhere else.
    Please mark if it helps

  • ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP

    In my data model (load from a database) there is this data control and its accessor return.
    When I drag the accessor return inside a jsf page I create a adf read only table (that has about 5000 rows), the I run the page and it works.
    Since I want to display only 20 ( or 50 or 100 is the same) rows for each page I had changed the access mode from the default value "Scrollable" to "Range Paging" and then I ve selected range size 50.
    Now if I run hte jsf page there are no data to display and if I press the small triangles to order the column or insert a word in the filter field I have the message ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP.
    I dont know how to do to solve this problem.
    Stefano

    An other thing.
    I solved this problem, maybe I dont understand the meaning of access mode and range size , since every value I choose of these 2 fields the visualization of the table doesnt change.

Maybe you are looking for