Update view ( view is based on 3 tables)

i have view based on 3 tables.
create view view_master
select '1' as no , name , no from a
union all
select '2' as no , name , no from b
union
select '3' as no , name , no from c
actually i wanted to update view base table, Can i update a view view_master ?
My question here is does oracle support view update ( view is based on 3 tables)
Please advise ,,,

Apart from Instead of trigger any other work around? The best way to answer that question is if you let us know:
- your database version ( select * from v$version; )
- give us a narrowed down example of the 'begin-situation' and the desired 'final situation'.\
See:
{message:id=9360002} for more details.
MY ORACLE DBA hates tiggers .He's not the only one ;)

Similar Messages

  • Updating checkbox in realtime based on other table

    Hi All,
    using apex 2.2.1, database 10.2.0.3
    I have a check box that I want to update based on the user selecting a radio box. e.g. Once the user has updated the radio box the checkbox is either switch on or off.
    I understand this needs to be done via a javascript but the issue I'm facing is that I need to do a SQL statement to get the the correct value as it is on another table.
    cheers
    James

    After doing more searching I'm pretty sure I need to call PL/SQL in a javascript. I'm new to all this and the only examples seem to complicated to understand.
    I'm sure someone has done this before. I would be gratefull if some could post their PL/SQL and the javascript / AJAX into this note so I can reverse engineer it.
    cheers
    James

  • Workaround for ORA-02060: update on view with db-link

    Hello,
    In my application I have a page that is based on a view. This view itself is based on a table in the same database and a table in another database which I pick up through a db-link.
    To update the data in the view I have created an instead-of trigger which handles all the DML (which is a direct update on the local table and a message towards a broker for the update of the remote database).
    When updating from the database with a statement like UPDATE VIEW SET COLUMN1 = VALUE WHERE COLUMN2 = PK_ID, there is no problem. Everything is triggered in the right way.
    But when I want to update a row in my APEX page I get 'ORA-02060: select for update specified a join of distributed tables'. This is due to the fact that APEX fetches the row as SELECT * FROM VIEW FOR UPDATE.
    How can I work around this? I don't need the locking mechanism that 'FOR UPDATE' provides, because I can solve that myself. So basically, can I alter APEX's statement that performs the Automatic Row Processing (DML)?

    So you answered your question yourself :) Pretty or not, it does the work. Imagine programmers beeing able to work only using wizards and have no clue about what they do. What kind of quality would you get? :)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Want to update data in a view based on multiple tables

    Hi
    I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any alternative please let me know.
    Thanx
    Devinder

    Devinder,
    The table can be updated through a view based on multiple tables, if and only if the table is a "key preserved" table. Rather than explaining myself, i avoided the burden of typing by finding the material in Oracle Docs and pasting it for you :-)
    If you want a join view to be updatable, all of the following conditions must be
    true:
    1. The DML statement must affect only one table underlying the join.
    2. For an INSERT statement, the view must not be created WITH CHECK
    OPTION, and all columns into which values are inserted must come from a
    key-preserved table. A key-preserved table in one for which every primary
    key or unique key value in the base table is also unique in the join view.
    3. For an UPDATE statement, all columns updated must be extracted from a
    key-preserved table. If the view was created WITH CHECK OPTION, join
    columns and columns taken from tables that are referenced more than once
    in the view must be shielded from UPDATE.
    4. For a DELETE statement, the join can have one and only one key-preserved
    table. That table can appear more than once in the join, unless the view was
    created WITH CHECK OPTION.
    HTH
    Naveen

  • View link between view based on entity(table) and view based on stored proc

    I've created a view based on a stored procedure. I need to link this view to a view based on an entity which is based on a table.
    I can create the view without issue, but when I attempt to run the application module that contains the relationship I get this error:
    (oracle.jbo.InvalidOperException) JBO-26016: Cannot set user query to view "SalesentityModuleApiView2" because it is a destination in a view link
    One thing that may be notable about this is that this view started out based on a database view. I later overrode the select related methods using the example here:
    http://download-east.oracle.com/docs/html/B25947_01/bcadvvo008.htm
    Any ideas? I will gladly post some code if someone will let me know what might help diagnose this.

    Hi,
    I solved my problem with adding transient field, and changing the value of it (true | false) on set method of field that can be changed so I can get which row was updated. What exactly do you mean when you say not updateable, I'm using a vo with no entity, and I can add, remove rows, in fact I think it's a good solution because I don't want to write to database immediately.

  • Insert a new row in log table when update on view object

    hi All,
    i have created approval System where i maintain log which is based on table(ApprovalLog) which contain attribute like (Agencycode,approve_status,approved_by,approved_date).
    and i have also create a view object which is based on (AgencyApproval) table. which is also contain field approval_status by default 'N'
    i create a jsf page using this view object and drag drop as adf table now i want when user change approve_status field and click on commit button then
    a new row created on to ApprovalLog table and values of column like (agencycode,approve_status,approved_by) comes from AgencyApproval table.
    How can i do this in ADF.
    Please Reply.
    manish

    hi Timo,
    i have done this as following and it is working.
    please tell me it is right approach or not.
            protected void prepareForDML(int i, TransactionEvent aTransactionEvent)
                if (i != EntityImpl.DML_DELETE)
                         ViewObjectImpl vo = (ViewObjectImpl)this.getDBTransaction().findViewObject("AdAgcrlimitAppLogView3"); // change it to the name of your VO
                           Row row = vo.createRow();
                           // set the values ...
                           row.setAttribute("AppDt",getAppDt() );
                           row.setAttribute("Publ",getPubl() );
                           row.setAttribute("GrpAgcode",getGrpAgcode() );
                           row.setAttribute("GrpAgsubcode",getGrpAgsubcode() );
                           row.setAttribute("StaticCrlimit",getStaticCrlimit() );
                           row.setAttribute("FixCrlimit",getFixCrlimit() );
                           row.setAttribute("VarcrLimit",getVarcrLimit() );
                           row.setAttribute("AdhocLimit",getAdhocLimit() );
                           row.setAttribute("AdhocFr",getAdhocFr() );
                           row.setAttribute("AdhocTo",getAdhocTo() );
                           row.setAttribute("CrAlertLimit",getCrAlertLimit() );
                           row.setAttribute("BillAmt",getBillAmt() );
                           row.setAttribute("AdjAmt",getAdjAmt() );
                           row.setAttribute("DbnAmt",getDbnAmt() );
                           row.setAttribute("PayAmt",getPayAmt() );
                           row.setAttribute("UnbillAmt",getUnbillAmt() );
                           row.setAttribute("Status",getStatus() );
                           row.setAttribute("AlertTag",getAlertTag() );
                        row.setAttribute("CrlimitTag",getCrlimitTag() );
                           row.setAttribute("Confirm",getConfirm() );
                           row.setAttribute("ApproveRemark",getApproveRemark() );
                           row.setAttribute("ApproveBy",getApproveBy() );
                           row.setAttribute("ApproveDt",getApproveDt() );
                           row.setAttribute("ApproveStatus",getApproveStatus() );
                           row.setAttribute("ApproveHier",getApproveHier() );
                           row.setAttribute("Usrname",getUsrname() );
                           row.setAttribute("Usrid",getUsrid() );
                           row.setAttribute("Usrdate",getUsrdate() );
                           row.setAttribute("Cuser",getCuser() );
                           vo.insertRow(row);
                       super.prepareForDML(i, aTransactionEvent);
            }

  • 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

  • Strange behaviour of view based on several tables join with union all

    Dear fellows we r facing a strange problem we have a view based on several tables joined by union all ,when we issue an ordered query on date,rows returned are unusually different than they should be .
    Is oracle has some special behaviour for view based on union all ?
    I m using oracle 8.1.6 on windows 2000
    Kashif Sohail

    Did you ever solve this problem? I have two select statements based on 4 tables and 3 views using about 5 more tables. When I execute each select individually I get exactly what is expected. When I UNION ALL both selects together, I get "no rows returned", however when I UNION them I get exactly what is expected. I should get the same answer for both UNION ALL and UNION. The two select statements are identical, except for one column where I changed the constant to be different. Any thoughts?

  • How to biod Crystal Reports based on ABAP Tables/Views

    Hi,
      Can any one post me some document stuff on building Crystal reports based on ABAP Tables/Views please!
    Thanks,
    Madhu.

    Hi,
    Check out the links below for Crystal Reports :
    Re: Crystal report in SAP BW
    http://support.businessobjects.com/documentation/product_guides/
    http://help.sap.com/saphelp_nw04/helpdata/en/86/06a8d3be17fc47aa8d850e50cf5f24/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/46/dfd33b1ed4b47de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/34/c0523e83464644e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5f72b7c0e943d99f4f5cef2bfacfe1/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/06/00a63b60f26e3be10000000a114084/frameset.htm
    Hope this helps.
    Cheers,
    Kedar

  • [Solved] How to update records in entity based on view with distinct

    Hi
    - I have a relational view of the form:
    SELECT DISTINCT
    FROM TAB1, TAB2, ...- I created instead of triggers for delete, update and insert.
    - I created an entity object on this and an updatable view object
    - I added this to my module.
    - Then I test the view object in the module (module > test), and if I try to update an existing record, I receive the error:
    (java.sql.SQLException) ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    So, ADF internally create as select FOR UPDATE cursor to update the modified record and as the error shows, this is not possible on a view with distinct, ...
    Is there a way to work around this error without to rewrite the view?
    I was thinking that there is maybe a way to force ADF not to use the select FOR UPDATE and use UPDATE .. SET <value> WHERE <pk>, or maybe to create a new instead of trigger to catch the select FOR UPDATE?

    Arti,
    Here's another solution (that will still use locking, and can help avoid the "lost update" problem):
    http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html
    John

  • Updatable , Dynamic VIEW OBJECT ??

    Hi ,
    I want to create a dynamic VO which is updatable.
    I dont have any information about the table on which my View Object is based on, at DESIGN TIME. At run time I create query for the view and create dynamic view using AM.createViewObjectFromQueryStmt(String, String) but this kind of view will not be an updatable view.
    I think if I use createViewObjectFromQueryClauses() from entity, it will be updatable,,,but in that I will have to create entities for all the table in my schema ..which sounds BAD...
    is there any thing as DYnamic Entities ??
    or any other trick to do this.....
    BC4J should support something like changing QUERY_DATA_SOURCE_NAME at runtime in oracle forms.. which allow you to update record.
    Thanx,
    Prasoon

    Hi Prasoon,
    Steve Muench's "Dive Into BC4J" page has the following example: http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html
    But this is based on pre-defined Entity Objects. It might give you some ideas, though.
    Good luck!
    Chris

  • Update a view in oracle forms

    Hi.
    I have a block based on a view ( this view is based on two tables). How do I update the base tables when the record based on this view is updated in the form?
    Thanks

    one way is to control the transaction by using database trigger " instead of "
    on the view.
    If a view is inherently updatable and has INSTEAD OF triggers, the triggers take preference. In other words, Oracle fires the triggers instead of performing DML on the view.
    second way is to execute a DML from the forms manually by intersepting the default functionality of on-insert, on-update trigger and so on..... to perform transaction on the table.
    But i'll recommend using the INSTEAD of triggers, see documentation for more help and examples.

  • One block based on two table when update/insert result in FRM-40654

    Hi,
    I ahve a multi line block based on two tables.
    Customers - AFCUSTOMER
    Maintenance - AFMAINT
    Some customers exist when maintenance doesnt so in my where clause i have
    AFCUSTOMER.CUSTID=AFMAINT.MAINT_CUSTID(+) AND AFCUSTOMER.CUSTBRANCHID=1 AND AFCUSTOMER.CUSTSTATUSID=2
    I have primary key set as the AFMAINT table primary key and have set DML data targetr name as AFMAINT.
    I am displaying customer name (from AFCUSTOMER) and type of payment (from AFMAINT) on screen and i want to change the type of payment which then uses pre update trigger to fil in the primary key of AFMAINT.
    Querying works fine and displays all records. But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another user. I have checked and block status is QUERY right before the list item is changed.
    Any ideas on where i am going wrong.

    But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another userWhen you start editing a record which is already stores in the database forms "rereads" the record from the database and check id all values in the database are the same as in the form. If there is some difference, forms assumes that someone else changed the record after you did the query.
    The main causes for that are:
    -Some database-trigger which changes the value of a column which is included in the form
    -numeric column with a higher precision in forms, than in the database
    -a block based on a view or "select from clause" which does not return the same values as inserted/updated through forms.
    I guess you run into the third issue. Check all the values in the forms-items after your dml and compare them to the values saved to the database, there will be some difference. If you find it, correct the error, if one, or re-read the data in the POST-UPDATE-trigger.

  • View with Bind Variable and ADF table

    Hi all,
    Please note what i have noticed. I created a view with a bind parameter, overriden the prepareSession of my Application Module to set the bind parameter and execute the query. I then created a simple jsf page and included the view as an adf read-only table. When i run the page, the prepareSession is called, sets the bind parameter, however the selected record of the table is always the second record (Not the first record).
    This behaviour can be reproduced with the HR schema. Please follow the below instructions for reproducing the problem.
    1. Create a Fusion Web Application (ADF).
    2. Create business components from tables.
    3. Create a new connection with the HR schema.
    4. Import the Departments table as an entity and then click finish.
    5. Create a view based on the Departments entity.
    6. Modify the Query to include a where clause (where DDepartmentsEO.DEPARTMENT_NAME LIKE :BindParam)
    7. Provide an order by clause (DepartmentsEO.DEPARTMENT_ID DESC)
    8. Creata a bind variable named "BindParam" of type string.
    9. Create an Application Module and include the view object.
    10. Open the Application Module Class and override the prepareSession method
    11. include the following code after super.prepareSession(session):
    ViewObject myView = this.getDepartments1();
    myView.setNamedWhereClauseParam("BindParam", "%");
    myView.executeQuery();
    12. Create a jsf page
    13. Drag the view object on the page as an adf read-only table, selecting the Row Selection, Sorting and Filtering
    14. Run the page.
    You will see that instead of the first record being selected, the second record in the table is selected.
    Can anyone please help me?
    Thank you

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

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

Maybe you are looking for

  • Multiple transactions control in the same page

    I am using the Jdev11g 11.1.1.4 and ADF BC, I am quite new for Jdev11g, My question is I have a page, there are a af: form region and two af:table regions inside the same page. the 'master' is in af:form and two its 'details' are in either af:table.

  • Anyone succeeded installing Adobe Air on Fedora 10?

    I just tried to install AdobeAir on my Fedora 10 GNOME system but got an error message:       Adobe AIR could not be installed. Either gnome-keyring or Kwallet must be installed prior       to installing Adobe AIR. But gnome-keyring is installed on m

  • CTAS method takes long time - Any suggestion.

    Hi, Please find the query below. The 'select' statement was taking more than a day time to execute and i tuned the same. Now i am getting the results in 5 seconds. But when i try to load the data that i get from 'select' statement into table using CT

  • Default Connection for SQL scripts

    Hi everybody. Can somebody tell me if there is a way to set a "default connection" in SQL Developer? What I want to achieve: When I'm opening an SQL script with the SQL Developer it should already be chosen a defined connection, so that I only have t

  • OEM for managing AS nodes

    Anyone here with experience in managing 9i AS (9.0.2) with OEM 9.2? (from what I have found, 9.2 can't handle 9.0.2... even if 9.2 can handle Database nodes from 8.1.7 and up - So one could say that OEM is not compatible with Oracle products :-O)