Impossible to update the display data

Hello
I created a simple view based on a table, but I can't update the data in the view. How can I do that.

Thank you

You will need create an INSTEAD OF trigger to update the base table of way...

for example

SQL> select * from test1;

     EMPID DT                        SALES       COMM
---------- -------------------- ---------- ----------
         1 26-SEP-2009 10:19:05        200          0
         1 29-SEP-2009 10:19:05        300          0
         1 06-OCT-2009 10:19:05        100          0
         2 01-OCT-2009 10:19:05        400          0
         2 04-OCT-2009 10:19:05        150          0

SQL> create view vw_sales as
  2  select empid, sum(sales) as sales, sum(comm) as comm from test1
  3  group by empid;

View created.

SQL> select * from vw_sales;

     EMPID      SALES       COMM
---------- ---------- ----------
         1        600          0
         2        550          0

SQL> update vw_sales set comm = sales*0.1;
update vw_sales set comm = sales*0.1
       *
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view

So, as a standard, we can update the display because it contains aggregates.

If we create instead of trigger on the view, we can grab the update and update "instead of" the view's base tables...

in my example, I'll answer to update the commission on the employee, by spreading the commission also on all sales for this employee records...

SQL> ed
Wrote file afiedt.buf

  1  create or replace trigger trg_vw_sales instead of update on vw_sales
  2  begin
  3    update test1
  4    set comm = :new.comm / (select count(*) from test1 where empid = :new.empid)
  5    where empid = :new.empid;
  6* end;
SQL> /

Trigger created.

So now, we should be able to update the view...

SQL> update vw_sales set comm = sales*0.1;

2 rows updated.

SQL> select * from vw_sales;

     EMPID      SALES       COMM
---------- ---------- ----------
         1        600         60
         2        550         55

It's looks right. The commission shall be 10% of the total value of sales. :)

And if we check the base table...

SQL> select * from test1;

     EMPID DT                        SALES       COMM
---------- -------------------- ---------- ----------
         1 26-SEP-2009 10:19:05        200         20
         1 29-SEP-2009 10:19:05        300         20
         1 06-OCT-2009 10:19:05        100         20
         2 01-OCT-2009 10:19:05        400       27.5
         2 04-OCT-2009 10:19:05        150       27.5

SQL>

... the commission is evenly distributed over the sales as we wanted.

;)

Tags: Database

Similar Questions

  • Impossible to update the display drivers for Satellite L650

    I have L650 and AMD ATI Mobility Radeon HD 5470.
    First of all, I wanted to update my drivers Toshiba program showing that this driver is old. OK, I downloaded, install and then, months later, window pop-up, this driver is always old. I did it again and I noticed that the driver is not updated at all.

    So I went to the ATI site, and there I discovered that the latest drivers for my card there but they will not work with Toshiba. Weird is, I tried anyway, they don't work.
    So I went to Toshiba site and start downloading AMD, each of them display drivers. None of them worked: errors or 'installation complete', but nothing works. I tried other sites with drivers for my model. Resut: Nope, once again.

    Finally, I found the most up-to-date drivers for my Radeon, from Toshiba Web site... from 2011. Is this some kind of joke? Why can't I have the drivers updated just because it is Toshiba? Why Toshiba is not updated their drivers, when the software they gave me with the laptop gives me alerts that my drivers are outdated.

    Hello

    > Why Toshiba is not updated their drivers, when the software they gave me with the laptop gives me alerts that my drivers are outdated.

    Many different laptop models were equipped with the same GPU. That's why you should also search for drivers of graphics cards that have been released for the new laptop models equipped with the same graphic card.

    > Yes, so I went to the ATI site, and there I discovered that the latest drivers for my card there but they will not work with Toshiba. Weird is, I tried anyway, they don't work.

    I read in various forums on graphics cards drivers and update issues.
    It seems that Toshiba provides special and changed graphics cards drivers that have been specially designed for mobile use. These drivers support a kind of protection which is important since s graphic portable units are equipped with large modules of cooling the overheating.

    However, there is a solution to install the page ATI original drivers, but the use of these drivers is at your own risk. You need to download the driver package that contains the dll and ini files.

    Then you should be able to update the driver through Device Manager by using the Advanced installation procedure which allows to point to the folder that contains the mentioned dll and ini files.

  • Impossible to update the display in the viewController project

    Hello

    I use Jdev studio edition 11.1.1.1.0.

    I inherited an existing application.
    I need to change the application of the existing view. I made and tested in the model project with the tester to bc4j. Everything works very well.

    But,
    When I deploy the project, there should be changes in the pages. All looks like that I have not modified the query from the view.

    An idea of the cause of this?
    It seems that security prevents the changes.

    Thanks for any help

    most of the time these are the questions which is because we do not update the project dependencies correctly.
    Build--> clean all [this will delete all classes and deployed pots]
    rebuild all the dependent project, and then run the user interface.

    Amit

  • Impossible to update the details of credit card, get the PMT_000008 error message

    Impossible to update the details of credit card, get the PMT_000008 error message all the time

    Is this another card or the same card but with slightly different details? (As the expiration date).

    Manage your Adobe Creative Cloud membership (Use the link 'Contact us' at the bottom, bottom right.)

  • How can I update the expiration date on my credit card account?

    How can I update the expiration date on my credit card account?

    How can I update the expiration date on my credit card account?

    Go to your Bank and get a new card.

  • Planted in the middle of the intallation: "could not update the registry data.

    My hard drive was a hardware malfunction and had to be replaced altogether. I just got my new hard drive, and after fit, he tried to install vista Home premium 32B, that came with my dell inspiron 530 computer. About 10 minutes after the installation a message announcing that "windows could not update the registry data" and "installation has been cancelled. This was repeated several times. Any ideas why and how to solve?
    Thank you.

    HI -.
    Other people who have had this problem report that choose NOT to do the updates during installation allows you to install finish. They are then installing updates once the installation is complete. You see an option to install no updatesa as part of the installation? Barb winter
    Program Manager of Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How mass update the display name for a group of existing emails?

    We were recently acquired and at the end of April will undergo a change of name of company official. Is there a way to mass update the display name for all or most of the emails without manual update of each individual file in the details by email? I know how to update the name of the company in the configuration > system management > company display settings > name of the company; However, this is only the default display name for e-mail messages that are created from that moment. It is not to update existing records, as I understand it. This will be a huge pain updates of each email for each existing campaign in the program generator, so if there is a solution, please let me know!

    sc * 2799241 * tr-j' thought that this might be the case. We will make do. Thanks for your reply.

  • I am trying to download the free trial for Mac, but it says that my system is no longer supported. Currently, my mac runs on 10.8.5 version but it seems impossible to update the mac. Someone knows how to fix this?

    I am trying to download the free trial for Mac, but it says that my system is no longer supported. Currently, my mac runs on 10.8.5 version but it seems impossible to update the mac. Someone knows how to fix this?

    Hi elizabethg,.

    Photoshop CC 2015 would require minimum Mac OS 10.9, therefor you can maximum download the trial version of Photoshop CC 2014 which is compatible with the version of Mac OS you have.

    Download link: direct download links of Adobe CC 2014: Creative Cloud 2014 Release. ProDesignTools

    We will also recommend you use Photoshop CS6 trial, because if in case you want to buy the trial then its available through the third party dealer as a standalone application.

    Download Creative Suite 6 applications

    Configuration of Photoshop

    Kind regards

    Mohit

  • After update, the display text of all my PDF files is not clear (I mean not not strong)! Any suggestion?

    After update, the display text of all my PDF files is not clear (I mean not not strong)! Any suggestion?

    Hello

    Please tell the Reader/Acrobat version you use.

    Also say work on the operating system.

    You can try the next step and see if that helps.

    Launch Reader/Acrobat > Navigate to Edit > preferences > Page Display > rendering > smooth text choose to monitor and click OK.

    See if that helps.

    Concerning

    Sukrit diallo

  • Unable to connect Adobe cloud after update the expiration date of credit card

    Unable to connect Adobe cloud after update the expiration date of credit card.

    The activation server show that CC has expired on 21 September, 2015. Please renew the subscription if possible or re-purchase.

    The best option will be to contact Adobe support for this.

    Concerning

    Stéphane

  • Impossible to update the full name with post-process Manager field

    Hello

    I have a manager post-process that updates some fields when a user is changed. The post-process Manager update correctly the e-mail, and common name fields. However, for some unknown reason, I am unable to update the display name. There is no error message, but the value is not updated.

    Here is the code I use to update the display name:

    EntityManager entityManager = Platform.getService (EntityManager.class);

    HashMap < String, Object > uploading = new HashMap < String, Object > ();

    attrs.put (UserManagerConstants.AttributeName.DisplayName.GetId (), 'New value');

    entityManager.modifyEntity (orchestration.getTarget () .getType (), userEntityId, uploading);

    There also seems to be something different with the full name field. When I print all the fields and values for a particular user, I get something like:

    First name = John

    Family name = Doe

    Email = [email protected]

    [...]

    However, the display name has the following format:

    Display name = {base = John Doe}

    I also tried to set a new value in the format "{base = new value}", but it does not work either.

    Am I missing something?

    Thank you

    -jtellier

    Display name must be placed in a Hashtable as follows:

    Map dispNameMap = new HashMap();
    dispNameMap.put ("base", lastName + "" + firstName); then pass this card as:

    Parameters.put ("Display Name", dispNameMap);

  • Impossible to update the data, i.e. no album covers

    When I find a medium such as a new rip cd, none of the album covers appear, no somg name or the information album burn the CD.  I tried to rebuild the library with no luck.  I can't manually display of information.  After that I sent the data, it returns to the unknown state.  And even though I have the album cover in the folder it atill is not updated.  If I use the option 'Finding information' automated, he finds the correct album, but after confirming the correct data, it always comes back to a stranger.  Help please.  With the help of MS 7 Home Premiun and latest version of media player 12

    Hello

    I am pleased that the issue is resolved. In the future if you face any problem windows let us know.
  • Re: Satellite C660 - update the display driver (PSC0QE)

    Hello to you all, wonderful people.

    I am writing this post to ask why the display driver for this model has not been updated since 2010
    I played a favorite game of mine (Civilization V) on this model. They have updated the game with a patch in November and the computer can no longer display graphics properly because the old drivers.

    I did my research on the game forums to try to solve this problem, and after watching my dxdiag his appeared clear that drivers are up to date. I've been on the Intel site and they have updated the drivers for the card (card Intel(r) HD), I downloaded these drivers but the laptop don't will not install them unless they are verified from Toshiba? My questions are...

    Why Toshiba stop me to install these drivers from the Intel website?
    and
    How can I get around all this Pfaff and update my graphic drivers?

    Thank you very much
    Tom

    Although it is not recommended the use of drivers Toshiba not can you please tell us what did you do exactly?
    Short feedback can be very useful.

  • Satellite L505-141 - update the display driver?

    I want to update the 5156 ATI mobility radeon video card driver. I checked in the Device Manager the driver already installed on my machine, the version of it is 8.653, similar to that offered by download here
    http://EU.computers.Toshiba-Europe.com/innovation/download_drivers_bios.jsp?service=EU

    However, the stated release date is 09/08/2009, while on the site the date is 03/05/2010. Is - this besically the same version? Should I update?

    Exactly how to upgrade the video driver to the laptop (I know how to upgrade video driver on desktop PC with nVidia card, but have no experience with the release of ATI card to the laptop).

    Hi lyonya,.

    For me, it seems to be the same version but generally an update of the display driver and all other updates the driver should only be carried out if it of necessary.

    This means that if your computer works without any problems, you do not need to update a driver. Have fun with your laptop.

    Never touch a running system ;)

  • PC: update the display driver

    Hi, I write it on behalf of my friend... When I play HD vedios, System (PC) does not support. System have 1 GB of RAM. I tried to install K-Lite codec palyer (my favorite one). it installed but jumped a messege this graphics driver does not support this... But reading a few low-resolution Vedio as other players do like VLC, windows Media Player...

    My display driver is Intel (r) 82865 G graphics controller.  Version - 6.14.10.4363, Date: July 19, 2005.

    Hardware ID is-

    PCI\VEN_8086 & DEV_2572 & SUBSYS_0C4A8086 & REV_02
    PCI\VEN_8086 & DEV_2572 & SUBSYS_0C4A8086
    PCI\VEN_8086 & DEV_2572 & CC_030000
    PCI\VEN_8086 & DEV_2572 & CC_0300

    -----------------------------------------------------------------------------------------------

    I think that the driver is too old and its need to update... But my problem is I know not how do you know which is the latest version of above graphics controller and of the place where I can download for my windows 7-32 bit system... The PC is not an internet connection so I'm not able to update driver automatically...

    So please can someone tell me how to know the latest version of the graphical controller without connecting to the Internet... Ideal if you can give me a link...

    I will be very obeliged to you

    @Pradeep_sfdc ,

    Hello and thanks for the display on the HP support forums.  Please visit the following link.  It will help you when posting on the forums.

    Tips for the "very best question.

    And when you post back please include your full model and product number.

    Computers how can laptops HP - I find my model number or product number?

    For any software and driver for your system.  The only ones that are supported are located on your systems support page.  Please post back with the information on your computer, and I can provide the link supported.

    Thanks again for posting and have a great day.

Maybe you are looking for