Issue in Updating View

Hi All,
I have created a view as below :
Create or replace view test as
select employee_id,first_name,last_name,department_id,department_name from
(select employee_id,first_name,last_name,d.department_id department_id,d.department_name department_name
from employees e,departments d
where e.department_id = d.department_id
and d.department_id = 10)
View created with the following record :
EMPLOYEE_ID FIRST_NAME LAST_NAME DEPARTMENT_ID DEPARTMENT_NAME
200 Jennifer Whalen 10 Administration
Employee_id is the pk of employees table and department_id is the pk of the Department table. Also my view contains no duplicate value from any of the tables.
As per my understanding my View is a Key-Preserved View. But i am not able to update the view as below :
update test set department_name = 'Admin'
where department_id = 10
When i am trying to update the view i am getting the error as
update test set department_name = 'Admin'
ERROR at line 1:
ORA-01779: cannot modify a column which maps to a non key-preserved table
Can anybody please tell me what is wrong in it?

here is an extract from the Oracle documentation,
-It is not necessary that the key or keys of a table be selected for it to be key preserved. It is sufficient that if the key or keys were selected, then they would also be key(s) of the result of the join.
when u check your view that has been created, employee_id preserves the key property but the department table columns does not.
Further it also explains that,
-The key-preserving property of a table does not depend on the actual data in the table. It is, rather, a property of its schema and not of the data in the table. For example, if in the EMP_TAB table there was at most one employee in each department, then DEPT_TAB.DEPTNO would be unique in the result of a join of EMP_TAB and DEPT_TAB, but DEPT_TAB would still not be a key-preserved table.
hope this helps you

Similar Messages

  • Issue in Invoking an Updatable View with Instead of Trigger

    Hi,
    I am trying to insert a record using Updatable View with Instead of Trigger. When i try to save the data, i get the below error:
    java.sql.SQLException: ORA-01403: no data found
    ORA-06512: at line 1
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1075)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3887)
    at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9323)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1508)
    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:432)
    at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8566)
    Can someone help me resolve this issue?
    Also it would be great if you can share Sample codes for Invoking an updatable view with instead of trigger on Save/commit.
    Regards,
    Jeevan

    As a trigger is executed in the db and not in your app it's really hard to help as you did not give any useful information.
    Have you read this blog http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html ?
    Timo
    Edited by: Timo Hahn on 22.09.2011 09:15
    And my friend google also found http://technology.amis.nl/blog/1447/adf-business-components-resfresh-after-insertupdate-and-instead-of-triggers

  • Issue while updating field SCHZU (shift Premium) in table view  V_T508A

    Hi All,
    I am facing an issue while updating the field SCHZU(Shift premium) in Table view V_T508A.For some WSR entries when i am trying to update the shift premium say with a value 19400,the value is accepted.However for some other WSR entries,the value for shift premium gets modified to 19.400.Can someone please let me know why this error is occuring and how to rectify the same.
    Regards,
    Punam Jha

    usually its a percentage value. please check what value you enter

  • Updatable View as data block source - can't get to work

    I have created a simple form with one data block based on an updatable view, but it doesn't work properly after the form executes a query.
    I can use DML on this view using SQL*Plus and it works as it should.
    DML works in the form too, but only until I execute a query, after that I get the "FRM-40602: cannot insert into or update a view" error each time I try an insert, update, or delete.
    This is repeated for each runtime of the form. I have set the "query only" property to yes for the non-DMLable item from the view so that isn't part of the problem. This is an example out of "Developer Advance Forms and Reports (page 112) - Oracle Press" so it should work. There is nothing else (code, triggers, etc...) in this module besides the one data block.
    Any ideas would be appreciated.
    Thanks. Bill Brosnan.

    I have had the same issue and had to go through Oracle Support to get it working.
    First of all make sure that you have a recent patch installed (patch 9 as being the latest one available).
    Second, set in the data block the property key mode to updatable and the property primary key to yes for one item of the data block. (this is bug 1561423)
    Make sure that you only modify those columns that are updateable.
    Quite a large number of bugs have been reported on the concept of updatable views and the installation of a recent patch will most definitely get you working again.
    This functionality does work !
    Goodluck,

  • September Email Service Issue- Daily Updates

    Hi All-
    I wanted to let you know that Verizon is aware of the email issue effecting many of you today and our team is working to fix it as quickly as possible. For up-to-date information regarding this, please visit Verizon's Outage page here.
    I'll update this thread as I hear more.
    Thank you for your patience!
    -Heather

    On Thursday morning, September 12, 2013, Verizon experienced a service disruption that affected your email account.  You now are able to send and receive email normally and will continue to have access to your calendar and address book. 
    We are diligently working to recover any of your email folders that cannot be seen at this time. When the issue is fully resolved, email previously sent or received and any personal folders you created prior to this interruption will be available.
    While Verizon is working to resolve this issue, you can view updates as new information us available on verizon.com/outage.
    If you regularly use a POP email client such as Microsoft Outlook, Yahoo or Mac Mail you may not have noticed any adverse impact outside of the temporary inability earlier today to connect to your servers.
    We sincerely apologize for any inconvenience this disruption has caused.

  • Updating Views in sql server

    Hi,
    I am trying to update a view but the result is 0 row(s) updated
    ALTER VIEW vw_AuthorizedStationeries
    AS
    SELECT StationeryID,
    CreatedOn,
    StationeryName
    FROM dbo.Stationeries
    WHERE Authorized = 1
    GO
    -----------------Update Views-------------------
    UPDATE vw_AuthorizedStationeries
    SET
    CreatedOn = GETDATE()
    WHERE
    StationeryName = 'StationThree'
    GO
    What am I doing wrong?
    I am trying to update the column 'CreatedOn' with todays date where the row is 'StationThree'.
    Is it even possible to what I am trying to do using Views?
    Thanks!

    Its possible so far as view retrieves a record which satisfies your specified condition ie 
    StationeryName = 'StationThree'
    You can check if there are records satisfying condition using below query
    SELECT COUNT(*)
    FROM dbo.Stationeries
    WHERE Authorized = 1
    AND StationeryName = 'StationThree'
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Syncing issues after updating to 10.3.1.55

    After upgrading to itunes 10.3.1.55, today, it no longer recognizes my iPhone 4. I plug it in, the iPhone makes its normal syncing noice. I get a prompt, like always about it recognizing the camera and how i want to handle it. I cancel it, as usual, and then it never shows up in iTunes. I close itunes, connect my phone and it does not start itunes as it normally should. No error messages, just no response. Can anyone help with ideas?

    I had the same issue, after updating to 10.3.1.55 it would error out saying something along the lines of not being able to read the catalog or something.  I think the error even states do a restore to fix it.  Last night that is what I did, clicked restore and then had it transfer all my items back.  I'm glad I had just synced my phone prior to the update so the restore was really current.

  • Issue in Updating Sales Order Document flow

    Hi Experts,
    We have developed a Z Program for posting Material document for the deliveries of Sales Order. This program runs in Batch job everyday.
    Here we are getting an issue like in some of the cases it's not updating the Document flow of the Sales order though its Posting Material Document for the Delivery of Sales Order. If there will be a bulk amount of data then its creating issue in updating the Document flow ( Either the 1st set of record or last set of records).
    We are using BAPI 'BAPI_GOODSMVT_CREATE' for posting Material Document for the delivery and FM 'RV_DOCUMENT_FLOW_UPDATE_U' for updating the document flow.
    It seems it giving issue with bulk amount of data. Will it a time issue?
    If any one have faced such issue, please throw some pointers.
    Thanks in advance!
    Regards,
    Priyabrata.

    It could be a timing issue. After you create the material document, try to enque the material document and move to the next step  only if the enque is successful.  Keep trying to enque the material document until u are successful. But make sure you exit the loop after certain number of tries to avoid endless loops.  Here is a sample code:
      DO 20TIMES.
        CALL FUNCTION ;'ENQUEUE_EMMKPF'
          EXPORTING
            MODE_MKPF      = co_e
           MBLNR          = xxxxx
          MJAHR           = xxxx
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
        IF sy-subrc EQ 0.
    dequeue/unlock the notification again
          CALL FUNCTION DEQUEUE_EMMKPF
            EXPORTING
              MODE_MKPF= co_e
           MBLNR          = xxxxx
          MJAHR           = xxxx
         EXIT.
        ELSE.
    in case of no success, wait 1 seconds, before try again
          CALL FUNCTION 'RZL_SLEEP'
            EXPORTING
              seconds        = 1
            EXCEPTIONS
              argument_error = 1
              OTHERS         = 2.                               "#EC *
        ENDIF.
      ENDDO.
    Regards,
    Jitendar

  • Issue in Updating Date Fields in JDBC

    Hi Experts ..
      I am having issues in updating date fields in Oracle Database.
    My Sender Sends date in format 2007-05-19T14:34:55.0000000+02:00
    Can any one please suggest me how does the above format can be updated in JDBC with format 2007/05/19
    Thanks !

    Hi,
    See this Scree shot
    http://img517.imageshack.us/my.php?image=16324662pf7.jpg
    Take the Substring Function From Text Functionsand mention the position from 0 to 10 to take the Date alone from the Whole String which is getting in Source Field.
    And after that apply the Transform date Function fron Date Functions and mention the source date format and the target date foramt that needs to convert into.
    REgards
    Seshagiri

  • Firewire epson R2400 issues after update to 10.8.4 will not print causes system shutdown

    anyone had similar issue and or a fix?

    issues after update
    Download and install new drivers from the Epson site for your printer model.
    Epson Stylus Photo R2400, Drivers & Downloads - Technical Support - Epson America, Inc.

  • Update View SM30

    Hallo Guru,
    have you ever had this problem:
    I have created an update view, but when I try to update data via SM30... well, even if I save, no data is really saved...

    No, no events...
    I have:
    1. Created a Z table
    2. Created an update view for the table
    3. Created a maintainance view for the view.
    3. goto transaction SM30
    4. I make modifications, but no data is saved...

  • Issues or updates today?

    Any issues or updates today? Suddenly, the following behavior: log in, iTunes opens, bounced back to log-in page.
    iMac   Mac OS X (10.4.9)  

    Seems to work okay for us ... are you still having the problem?
    One of the things that Ken Newquist put me onto (and I've heard Apple Duncan say the exact same thing) is that the server running your transfer CGI may have a clock out of sync with Apple's clocks. If you append the debugging suffix to the URLs generated by your transfer CGI, you should be able to see if there's a problem with time synchronization.

  • Issue with Update of Table VARINUM

    Hi,
    I am getting waiting Issues with Update of table VARINUM. Has anybody faced such an issue.
    I have a lot of Jobs which are running in background. I am submitting it through a report. what can be the issue.
    Regards,
    Abhishek jolly

    Thisi is quite old, but not answered properly yet, so there you go:
    SAP generates a new job and temporary variant on report RSDBSPJS, for each HTTP call,which creates database locks on table VARINUM .
    This causes any heavyweight BSP application  to hang and give timeout errors.
    The problem is fixed applying OSS note 1791958, which is not included in any service pack.

  • When will Adobe issue an update to Camera Raw to include the Olympus E-M 5 MARK II camera?

    When will Adobe issue an update to Camera Raw for CS6 and Lightroom 5 to include the Olympus E-M 5 MARK II camera, does anyone know?

    What I wonder is when folks will start researching their favorite software BEFORE buying a new camera model?
    I have never seen a cart pulling a horse!!
    We know the our software, we know the new camera will be 'ahead' of updates. its the time between that we all seem to just accept. We should not.
    We can go round in circles pointing fingers as to who is to 'blame', thats not the point. The point is, no matter how far you go back, since the advent of digital this has been a problem. Posting on all web sites as far back as I remember contain "when will there be RAW support for xyz?". There are even some on this site back in 2006 asking the same question.
    The interdependent link between camera makers & software vendors is not working properly. They need each other yet don't support each other. Do you think Adobe thought up DNG just as a exercise? From memory it was an attempt to standardize, with an open code, a raw format that was universal. I blame Canikon for not wholeheartedly supporting it. Then the Oly, Panny alliance come along with MFT, an ideal opportunity, but proprietary issues prevail as if they got some sort of advantage from it. They don't IMO.
    Sorry for the rant, got carried away! Its just so frustrating.

  • Issue with Tree view

    Hello experts,
    I am facing a very strange issue with tree view.
    I have created a custom component with a tree view. All data are coming in the tree view. But the strange thing is that the data is not getting displayed on the screen.
    I am sure about the data because, when I am selecting a line from the tree, the data from that line is coming to the main screen.
    Please help!!
    Regards
    Debolina

    Hi experts...
    Any pointers to this issue???
    Please help!
    Regards,
    Debolina

Maybe you are looking for

  • How do I Put contact information into iCal event

    I am creating an event in iCal. I want to use an existing contacts name as the title of the event and their address as the 'where'. I don't want to use the invite tab. Some will not have email addresses anyway. I want to do this on my iPad. Anyone kn

  • Subcontracting process where Material Supplied by vendor

    Hello Gurus, If anyone can provide me input how to map subcontracting scenario with subcontracting challan where some material is also added by vendor(Which is unknown at the time of raising purchase order). This additional componenet also attracts e

  • Regular Expression he!!  =)

    Okay, the regexp needs to dig through an HTML file and print out all the links. Here's what I've got: Pattern p = Pattern.compile("a\\shref=\"(.)+\"", Pattern.MULTILINE); Matcher m = p.matcher(fileData); while (m.find()) { System.out.println(m.group(

  • OID installation : Oracle Directory Manager

    Hello This is a 'please tell me what step i am missing' type of question. I have completed the OID installation. When I login into the Oracle Directory Manager using the cn=orcladmin user I see a blank page and most of the Menu Items greyed out. Can

  • Working Offline with RoboSource

    Hello, I've been working with RoboHelp at my office and I am going to become a remote employee in the coming weeks. I am wondering a few things about RoboHelp and RoboSource. I am relatively new to the RoboHelp software. Firstly, can I work on a Robo