Update join view

1. employees table- emp_id is the primary key
2. department table-dept_id is the primary key.
3. Create or replace View emp_dept AS select e.emp_id, e.last_name, d.dept_id
From employees e, department d
4. update emp_dept
set last_name = 'munir'
where emp_id = 11
ORA-01779: cannot modify a column which maps to a non key-preserved table
Can someone pls tell me how i can fix it?
Thanks.

Note the name of this forum is SQL Developer *(Not for general SQL/PLSQL questions)* - so for issues with the SQL Developer tool. Please post these questions under the dedicated SQL And PL/SQL forum.
Regards,
K.

Similar Messages

  • Insert, update and delete on updatable join views

    Hi I need to insert, update and delete data in a views. I tried the foloing example
    http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10739/views.htm#i1006232
    We have two tables:
    CREATE TABLE dept (
    deptno NUMBER(4) PRIMARY KEY,
    dname VARCHAR2(14),
    loc VARCHAR2(13));
    CREATE TABLE emp (
    empno NUMBER(4) PRIMARY KEY,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    mgr NUMBER(4),
    sal NUMBER(7,2),
    comm NUMBER(7,2),
    deptno NUMBER(2),
    FOREIGN KEY (DEPTNO) REFERENCES DEPT(DEPTNO));
    and one view:
    CREATE VIEW emp_dept AS
    SELECT emp.empno, emp.ename, emp.deptno, emp.sal, dept.dname, dept.loc
    FROM emp, dept
    WHERE emp.deptno = dept.deptno
    AND dept.loc IN ('DALLAS', 'NEW YORK', 'BOSTON');
    this update command works successfully
    UPDATE emp_dept
    SET sal = sal * 1.10
    WHERE deptno = 10;
    but this one fails because it attempts to modify the base dept table, and the dept table is not key preserved in the emp_dept view.:
    UPDATE emp_dept
    SET loc = 'BOSTON'
    WHERE ename = 'SMITH';
    I tried to create the view with "WITH CHECK OPTION" clause but whith no success :(
    My question is: how can I do this with a simple across this view. I rather not use Instead Of Trigger because it take a lot of PL/SQL code :(
    thanks in advance
    Operator

    UPDATE emp_dept
    SET loc = 'BOSTON'
    WHERE ename = 'SMITH';But that doesn't make sense. You cannot just LOC for SMITH, because LOC is not an attribute of EMP. If you change the LOC in the view then you must change it for all employees in DEPT 30 (or whatever).
    The key preserved thing is merely about maintaining your data integrity.
    I rather not use Instead Of Trigger because it take a lot of PL/SQL code :(The problem is, your business rule is not clear. Are you wanting to change the LOC for the DEPT record which is the DEPTNO to which SMITH belongs? Or are you wanting to change SMITH's DEPTNO to be the one for the BOSTON office?
    Cheers, APC

  • How to putXML on a joined View?

    Hi
    I would like to insert an XML document into two tables (some
    elements into table 1 and some into table 2). I have created a
    joined view of the two tables and have tried to insert into the
    view with:
    java OracleXML putXML -user %USER_PASSWORD% -filename myfile.xml
    myView
    But I get the error "cannot modify a column which maps to a non
    key-preserved table". PLEASE GIVE A SPECIFIC EXAMPLE OF AN
    UPDATABLE 'VIEW' WHERE AN INSERT CAN MODIFY MORE THAN ONE
    UNDERLYING TABLE. Is it possible?
    Any example will do. But here is what I tried to do. I tried
    to map the first few ROW child elements of an XML document (shown
    at the bottom) into columns of the EMP table and the remaining
    child
    elements into another table called RELATIVE (this is a table
    containing next-of-kin contact information for each employee). I
    created a RELATIVE table with:
    CREATE TABLE RELATIVE (
    IDREL NUMBER(15) PRIMARY KEY,
    EMPNUM NUMBER(4) CONSTRAINT FK_REL REFERENCES SCOTT.EMP(EMPNO),
    RNAME VARCHAR2(20) NOT NULL,
    TEL NUMBER(14),
    STREET VARCHAR2(30),
    CITY VARCHAR2(20),
    STATE VARCHAR2(10),
    ZIP VARCHAR2(12),
    COUNTRY VARCHAR2(20)
    I added a EMPNO_DUP column to the EMP table that is a copy of
    the
    EMPNO primary key (I did this so as to use EMPNO_DUP for the two
    table join, rather than the EMPNO primary key. My first attempts
    to make the joined view with EMPNO also gave the same error). I
    wrote a PL/SQL trigger than would make sure that EMPNO_DUP and
    EMPNO remain in synch if EMPNO is updated or if there is an
    INSERT on EMP. Then I created a joined view of EMP and RELATIVE
    with:
    CREATE OR REPLACE VIEW EMPREL
    (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, EMPNO_DUP
    IDREL, EMPNUM, RNAME, TEL, STREET, CITY, STATE, ZIP, COUNTRY)
    AS SELECT
    E.EMPNO, E.ENAME, E.JOB, E.MGR, E.HIREDATE, E.SAL, E.COMM,
    E.DEPTNO,E.EMPNO_DUP,
    R.IDREL, R.EMPNUM, R.RNAME, R.TEL, R.STREET, R.CITY, R.STATE,
    R.ZIP, R.COUNTRY
    FROM EMP E, RELATIVE R WHERE E.EMPNO_dup=R.EMPNUM;
    I tried to insert the XML document shown at the bottom with:
    java OracleXML putXML -user %USER_PASSWORD% -filename myfile.xml
    myView
    I also tried the direct SQL command:
    INSERT INTO EMPREL
    (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO,EMPNO_DUP,
    IDREL, EMPNUM, RNAME, TEL, STREET, CITY, STATE, ZIP, COUNTRY)
    VALUES
    (7944, 'WIZARD', 'CLERK', 7782, '25-JUL-82', 1325, 0, 10, 7944,
    1, 7944, 'SUE', 4087200111, '200 MAIN ST.', 'PALO ALTO', 'CA',
    '94043', 'USA')
    Both attempts resulted in this error message:
    "cannot modify a column which maps to a non key-preserved table"
    I would really appreciate an example of how to create an
    updatable view where two or more underlying tables can be
    modified. Thanks.
    Regards
    Mehran Moshfeghi
    Here is the sample XML file. I want the first set of elements to
    map to EMP table columns and the second set of elements (after
    the blank line) to map to the RELATIVE table columns.
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <EMPNO>7942</EMPNO>
    <ENAME>GUNNEL</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7782</MGR>
    <HIREDATE>1982-02-25 00:00:00.0</HIREDATE>
    <SAL>1350</SAL>
    <DEPTNO>10</DEPTNO>
    <EMPNO_DUP>7942</EMPNO_DUP>
    <IDREL>2</IDREL>
    <RNAME>SMITH</RNAME>
    <TEL>6504262551</TEL>
    <STREET>2171 LANDINGS DRIVE</STREET>
    <CITY>MOUNTAIN VIEW</CITY>
    <STATE>CA</STATE>
    <ZIP>94043-0837</ZIP>
    <COUNTRY>USA</COUNTRY>
    </ROW>
    </ROWSET>
    null

    Hi Mehran,
    This is a classic view update problem where the database cannot
    figure out automatically which table(s) to update given a join
    view. Any update/insert/delete cannot act on more than one
    table.So if you are updating a column in a join-view, then that
    column must map to a particular column of a single table
    unambigously. You should look at the documentation on updatable
    join views.
    One of the easiest solutions to your problem is to create
    INSTEAD-OF trigger on those views. INSTEAD-OF triggers are
    triggers that can be created over non-updatable views to make
    them updatable. Here in the trigger body you specify the
    appropriate insert statements into the base tables. So your view
    can be as complicated as possible and yet updatable using these
    triggers.
    Thx
    oracle XML team
    Mehran (guest) wrote:
    : Hi
    : I would like to insert an XML document into two tables (some
    : elements into table 1 and some into table 2). I have created a
    : joined view of the two tables and have tried to insert into
    the
    : view with:
    : java OracleXML putXML -user %USER_PASSWORD% -filename
    myfile.xml
    : myView
    : But I get the error "cannot modify a column which maps to a
    non
    : key-preserved table". PLEASE GIVE A SPECIFIC EXAMPLE OF AN
    : UPDATABLE 'VIEW' WHERE AN INSERT CAN MODIFY MORE THAN ONE
    : UNDERLYING TABLE. Is it possible?
    : Any example will do. But here is what I tried to do. I tried
    : to map the first few ROW child elements of an XML document
    (shown
    : at the bottom) into columns of the EMP table and the remaining
    : child
    : elements into another table called RELATIVE (this is a table
    : containing next-of-kin contact information for each employee).
    I
    : created a RELATIVE table with:
    : CREATE TABLE RELATIVE (
    : IDREL NUMBER(15) PRIMARY KEY,
    : EMPNUM NUMBER(4) CONSTRAINT FK_REL REFERENCES SCOTT.EMP
    (EMPNO),
    : RNAME VARCHAR2(20) NOT NULL,
    : TEL NUMBER(14),
    : STREET VARCHAR2(30),
    : CITY VARCHAR2(20),
    : STATE VARCHAR2(10),
    : ZIP VARCHAR2(12),
    : COUNTRY VARCHAR2(20)
    : I added a EMPNO_DUP column to the EMP table that is a copy of
    : the
    : EMPNO primary key (I did this so as to use EMPNO_DUP for the
    two
    : table join, rather than the EMPNO primary key. My first
    attempts
    : to make the joined view with EMPNO also gave the same error).
    I
    : wrote a PL/SQL trigger than would make sure that EMPNO_DUP and
    : EMPNO remain in synch if EMPNO is updated or if there is an
    : INSERT on EMP. Then I created a joined view of EMP and
    RELATIVE
    : with:
    : CREATE OR REPLACE VIEW EMPREL
    : (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, EMPNO_DUP
    : IDREL, EMPNUM, RNAME, TEL, STREET, CITY, STATE, ZIP, COUNTRY)
    : AS SELECT
    : E.EMPNO, E.ENAME, E.JOB, E.MGR, E.HIREDATE, E.SAL, E.COMM,
    : E.DEPTNO,E.EMPNO_DUP,
    : R.IDREL, R.EMPNUM, R.RNAME, R.TEL, R.STREET, R.CITY, R.STATE,
    : R.ZIP, R.COUNTRY
    : FROM EMP E, RELATIVE R WHERE E.EMPNO_dup=R.EMPNUM;
    : I tried to insert the XML document shown at the bottom with:
    : java OracleXML putXML -user %USER_PASSWORD% -filename
    myfile.xml
    : myView
    : I also tried the direct SQL command:
    : INSERT INTO EMPREL
    : (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO,EMPNO_DUP,
    : IDREL, EMPNUM, RNAME, TEL, STREET, CITY, STATE, ZIP, COUNTRY)
    : VALUES
    : (7944, 'WIZARD', 'CLERK', 7782, '25-JUL-82', 1325, 0, 10, 7944,
    : 1, 7944, 'SUE', 4087200111, '200 MAIN ST.', 'PALO
    ALTO', 'CA',
    : '94043', 'USA')
    : Both attempts resulted in this error message:
    : "cannot modify a column which maps to a non key-preserved
    table"
    : I would really appreciate an example of how to create an
    : updatable view where two or more underlying tables can be
    : modified. Thanks.
    : Regards
    : Mehran Moshfeghi
    : Here is the sample XML file. I want the first set of elements
    to
    : map to EMP table columns and the second set of elements (after
    : the blank line) to map to the RELATIVE table columns.
    : <?xml version="1.0"?>
    : <ROWSET>
    : <ROW>
    : <EMPNO>7942</EMPNO>
    : <ENAME>GUNNEL</ENAME>
    : <JOB>CLERK</JOB>
    : <MGR>7782</MGR>
    : <HIREDATE>1982-02-25 00:00:00.0</HIREDATE>
    : <SAL>1350</SAL>
    : <DEPTNO>10</DEPTNO>
    : <EMPNO_DUP>7942</EMPNO_DUP>
    : <IDREL>2</IDREL>
    : <RNAME>SMITH</RNAME>
    : <TEL>6504262551</TEL>
    : <STREET>2171 LANDINGS DRIVE</STREET>
    : <CITY>MOUNTAIN VIEW</CITY>
    : <STATE>CA</STATE>
    : <ZIP>94043-0837</ZIP>
    : <COUNTRY>USA</COUNTRY>
    : </ROW>
    : </ROWSET>
    Oracle Technology Network
    http://technet.oracle.com
    null

  • ORA-1779 when updating a view

    Hi and thanks in advance !
    i am facing a critical situation.
    i have two schema & both are same!
    the problem which i am facing is during updating a view of one i am facing above error while the same DML is issuing againt that view in other schema and that works fine.
    what's the reason..
    The major difference between two schema's is i hav different live and test database i migrate my access database to Oracle test database # 1.here i created a new user name deals . ok
    i hav done same migration in my another database but a little difference here user deals is already available here and tables and views are also available i drop all the object but forget to purge recyclebin. now whenever i try to issue DML at this schema i am facing above error while the same tables same data and same view is available in above databae where my update statement executed properly. one more thing i like to add here i hav some unwanted trigger 'BIN$##$$%##$# bla bla bla' on different table. i haven't created that .
    here is the view for your kind perusal
    CREATE OR REPLACE VIEW QRYREUTER AS
    SELECT FXdeals.deal_no,
    cparty.name,
    cparty.city,
    FXdeals.brokbill,
    FXdeals.deal_date,
    FXdeals.mode_id
    FROM FXDeals
    JOIN cparty
    ON FXdeals.cpcode = cparty.cpcode
    WHERE ( ( (FXdeals.mode_id) = 3 ) )
    Message was edited by:
    Fiz Dosani

    but i have sample scenario in other schema which replica of this schema so why i haven't got this error there
    one more interesting thing when i query select * from user_updateable_columns where table name ='ABC' in Schema # 1 it return i can modify some columns.
    but when issue the data dictionary view in schema # 2, where i was facing ORA-1779 , select * from user_updateable_columns where table name ='ABC' in Schema # 2 it return i can not modify any columns.
    Tables name are same in both schema.
    Data same in both schema.
    Constraint Same in both schema.
    Indexes same in both schema.
    why facing error in one schema not in other.
    one more interesting thing, i had faced questionable object error when importing DMP into schema # 2.

  • ORA-01776: cannot modify more than one base table through a join view

    I have created EO based on a database view than consists of two tables, and only one is updateable.
    When I try to update a row using EO, I got a following message: "ORA-01776-cannot modify more than one base table through a join view"
    In Forms, this issue is resolved by setting "Query Only" property of non-updateable items to "True".
    Is it possible to do something like that in ADF BC?
    Thanks

    Thanks for answer.
    When I set "updateable" property to "Never", that attribute is protected from any change.
    I'm sorry for incomplete usecase.
    I have set up a list of value on that attribute, because it is a lookup field for another table and I need to get an ID from that table.
    Basically, I need that attribute to be updateble for BC, but not for database.
    Edited by: MarioK on Oct 13, 2011 9:28 AM

  • Cannot modify more than one base table through a join view

    hi guys, my current problem is that i have a datablock based on a view, now all the fields bar 1 are updateable, but this one field that is obtained through a join is displayed, the user can enter data in this field which then pupulates other fields which are required, but this specific field should not be updated. Is there an option to state this as i keep getting the error:
    cannot modify more than one base table through a join view
    Any help would be greatly appreciated, thanks.

    the user can enter data in this field which then pupulates other fields So, using the value of "this field" you then query the rest of the fields? Can you show us the code you use to populate the rest of the fields?
    but this specific field should not be updatedHave you tried setting the "Query Only" property of the field to "Yes" and the other DML properties (Ins, Upd, Del) to No?
    Also, what is your Forms version?
    Thanks,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 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);

  • Join View

    Hi All,
    I am reading about the join view.I got stuck about the “Key-Preserved Tables".
    The general rules for Join View .
    UPDATE Rule
         All updatable columns of a join view must map to columns of a key-preserved table. See "Key-Preserved Tables" for a discussion of key-preserved tables. If the view is defined with the WITH CHECK OPTION clause, then all join columns and all columns of repeated tables are non-updatable.
    DELETE Rule     Rows from a join view can be deleted as long as there is exactly one key-preserved table in the join. If the view is defined with the WITH CHECK OPTION clause and the key preserved table is repeated, then the rows cannot be deleted from the view.
    INSERT Rule     An INSERT statement must not explicitly or implicitly refer to the columns of a nonkey preserved table. If the join view is defined with the WITH CHECK OPTION clause, INSERT statements are not permitted.
    Can any body clear about these points with sample examples..

    Do the manipulation on your tables in a ON-INSERT, ON-UPDATE and ON-DELETE on block-level triggers
    e.g.
    ON-UPDATE trigger
    Begin
    Update Table_1
    Update Table_2
    End ;

  • Can i update  a view

    Hi,
    Can I update,insert and delete record in a view
    Thanks

    Yes and No.
    Yes if:
    All updateable columns of a join view must map to columns of a key-preserved table
    No if:
    If a view is defined with the WITH CHECK OPTION then UPDATE, INSERT or DELETE cannot be done if violate constaraint.
    This is just a short (very short) version of what is in documentation.
    Peter D.

  • Cannot select ROWID from, or sample, a join view without a key-preserve

    I'm getting an error "cannot select ROWID from, or sample, a join view without a key-preserved table" when performing an INSERT. There is no error when performing an UPDATE.
    I created a "Form with Reports" page, where the Reports is based on a view multi table join. The primary key I chose during the form creation process is "From Trigger". The primary key "ACCESS_ID" has been defined in the base table. On the view, I have created an INSTEAD OF TRIGGER, for both Insert and Update. The update seems to work. I am using the automatic row processing for the update and insert.
    Additional information: My insert works standalone i.e. i write
    insert into jxjplntr_access_v (col1, ...)
    values (va1, val2...)
    and it works when i run it on SQL window.
    access_id has a constraint defined as not null and also PK.
    I have an insert "instead of" trigger defined on the jxjplntr_access_v view.
    However, when i "CREATE" a record after filling in the values, I get the above error. BTW, here is the view definition:
    CREATE OR REPLACE VIEW jxjplntr_access_v (
    access_id,
    person_id,
    person_name,
    badge_number,
    ntr_resp_type,
    primary_flag,
    start_date_active,
    end_date_active,
    created_by,
    created_by_uname,
    creation_date,
    last_updated_by,
    last_updated_by_uname,
    last_update_date,
    last_update_login )
    AS
    select
    access_id,
    ja.person_id,
    initcap(p.last_name||', '||p.first_name) person_name,
    p.employee_number badge_number,
    ntr_resp_type,
    primary_flag,
    ja.start_date_active,
    ja.end_date_active,
    ja.created_by,
    f1.user_name created_by_uname,
    ja.creation_date,
    ja.last_updated_by,
    f2.user_name last_updated_by_uname,
    ja.last_update_date,
    ja.last_update_login
    from jplntr.jplntr_access ja
    ,fnd_user f1
    ,fnd_user f2
    ,per_people_x p
    where f1.user_id(+) = ja.created_by
    and f2.user_id(+) = ja.last_updated_by
    and p.person_id(+) = ja.person_id
    Thanks in advance.
    K
    Edited by: kktong on Dec 12, 2011 5:39 PM
    Edited by: kktong on Dec 13, 2011 10:06 AM

    I've just been looking at exactly the same problem. From my initial investigations, this seems to be a bug with Apex and creating a tabular form, as described in this thread here:
    v4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,
    Very frustrating!
    I hope thats of use to you. If I find out anything else, I'll come back and let you know.
    Simon
    Edited by: Simon Holt on 26-Jul-2012 03:32

  • " 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 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

  • Update maintenance view data by FM .

    Hi friends,
             I want to update Maintenance view data  not by using sm30,sm34,transactions . i want to update by FM . i will pass the data and view name  so that it should update the data in views( and corresponding tables ) .
    and  we need these changes should be stored in change request also .
    Regards,
    Shiva.

    you can use FM
    VIEW_MAINTENANCE_NO_DIALOG
    with action parameter = 'SAVE'
    just do a where used list of this FM to check how this can be used
    Regards
    Raja

  • Creating a role to update a view

    Hi.
    Oracle 10.2.04. Linux 4.
    I have been reading about updating views. The Oracle documentation http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/views001.htm#i1006887 states that:
    The owner of the view (whether it is you or another user) must have been explicitly granted privileges to access all objects referenced in the view definition. The owner cannot have obtained these privileges through roles. Also, the functionality of the view depends on the privileges of the view owner. For example, if the owner of the view has only the INSERT privilege for Scott's emp table, then the view can be used only to insert new rows into the emp table, not to SELECT, UPDATE, or DELETE rows.
    This is helpful, but doesn't resolve my issue.
    A role has been created to allow access to a view called SALES_RESULTS:
    create role update NOT IDENTIFIED;
    GRANT INSERT, SELECT, UPDATE ON SALES_RESULTS TO update;
    GRANT update to user;
    When user tries to update the view however, an error is returned. (Sorry, I dont know the error just yet!!)
    In essence, my question is: in order for the updates to work, does the user 'user' need explicitly granted priviliges on the underlying objects, as stated in the Oracle doc extract above - which was discussing the owner of the view?
    Thanks.
    DA

    You have an actual example that shows it does not work. Also, it is stated in the documentation.
    What else do you need?
    Kind regards
    Uwe
    http://uhesse.wordpress.com

Maybe you are looking for