Updating a database view

Hi,
can you please tell me how can i update database 'z' view.
can we update as the same ways as we fill the data in database table by insert update command..
if there is any way to fill data in data base view please describe the process if any code you have it would be appreciated.
Thanks.

Database view does not have any data itself. It just sort of a build-up on the actual database table (or tables). For more on database views please see here:
http://en.wikipedia.org/wiki/View_(database)
If you are looking at a view in SE16, for example, and don't see the data that you'd expect, it means that data is not present in the database. Check the view definition in SE11 to see to which tables it is pointing. In ABAP programs you may use a view to select from the database, but I don't think you can use it to update database. I'm not 100% sure though - it just has never occurred to me to use a view for updates.

Similar Messages

  • Progammatic update a table with a database view  in the page

    Hi All,
    I am using JDev 11g. With FOD database schema, I have one database view Products which comes from two tables Products_Base and Product_Transactions. I created three EOs (ProductEO, ProductsBaseEO, ProductTransactionsEO) and three VOs (ProductVO, ProductsBaseVO, ProductTransactionsVO) based on their EOs respectively.
    Here is my scenario. I have an ADF form which is based on the database view Products and is dragged and dropped from Data Controls->ProductVO. When an existing record is submitted, a backing bean method will be called to update the data against the table Products_Base (and the table Product_Transactions at the same time) programmatically. An update method updateProductPrice() is added into the Application Module and published it to UI Client. The submit button in the page is created by directly dragging and dropping Data Controls->updateProductPrice into the page. When I run it, I got the following error message,
    Failed to post data to database during "Update": SQL Statement "UPDATE PRODUCTS ProductEO SET COST_PRICE=:1 WHERE PRODUCT_ID=:2".
    What I don't understand here is that, in my update method updateProductPrice(), it supposes to update the table Products_Base. But from the error, it appears that it is trying to update the view Products. Can anyone give me a help on what I did wrong here? When I try to debug it, it throws an exception to this line in the method updateProductPrice(),
    getDBTransaction().commit();
    Here are my codes,
    The method which got called in the backing bean
    public String cb6_action() {
    DCBindingContainer bc = (DCBindingContainer)getBindings();
    FacesCtrlAttrsBinding ProductId = (FacesCtrlAttrsBinding)bc.get("ProductId");
    FacesCtrlAttrsBinding CostPrice = (FacesCtrlAttrsBinding)bc.get("CostPrice");
    JUCtrlActionBinding action =
    (JUCtrlActionBinding)bc.findCtrlBinding("updateProductPrice");
    DCDataControl dc = action.getDataControl();
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    AppModule service = (AppModule)am;
    service.updateProductPrice(new Long(ProductId.toString()), CostPrice.toString());
    return null;
    public BindingContainer getBindings() {
    return BindingContext.getCurrent().getCurrentBindingsEntry();
    The update method defined in the Application module (AppModuleImpl.java)
    public void updateProductPrice(long productId, String costPrice) {
    ProductsBaseEOImpl product = retrieveProductById(productId);
    if (product != null) {
    try {
    product.setCostPrice(new Number(costPrice));
    getDBTransaction().commit();
    catch (JboException ex) {
    getDBTransaction().rollback();
    throw ex;
    catch (SQLException ex1) {
    getDBTransaction().rollback();
    private ProductsBaseEOImpl retrieveProductById(long productId) {
    EntityDefImpl productDef = ProductsBaseEOImpl.getDefinitionObject();
    Key productKey = ProductsBaseEOImpl.createPrimaryKey(new DBSequence(productId));
    return (ProductsBaseEOImpl)productDef.findByPrimaryKey(getDBTransaction(),productKey);
    Edited by: john wang on Oct 27, 2009 7:14 AM

    or
    merge into test
    using (select rowid rid
                , id
                , sub_id
                , startdate
                , lead (startdate) over (order by id, sub_id) - 1 ed
           from test) x
    on (x.rid = test.rowid)
    when matched then
       update set end_date = x.ed
    ;

  • Problem viewing/updating MySQL-database with utf-8 charset

    System specs:
    Tomcat 5.5.4
    JDK1.5.0
    MySQL 4.1
    Connector/J 3.0.16
    JSTL 1.1
    I am trying to build a guestbook web-app, and want to be able to store swedish characters (available in latin1) and decided to give utf-8 a go since it would support other languages as well. I use a <Resource> in my context-xml to get the connection.
    This simply will not work; when I use the <%@ page contentType="text/html; charset=utf-8"%> declaration, the swedish characters in the raw html-code gets replaced by questionmarks. Select-queries output look ok though, as long as they don't contain the character '�'
    When removing the page-declaration, the queries show only questionmarks where swedish characters should be.
    The same goes for updating my database. Swedish characters get garbled.
    I have tried the following without success:
    *adding &useUnicode=true&characterEncoding=UTF-8 to the Resource-url -- causes my web-app to fail loading.
    *adding a <filter> to the web-apps web.xml as suggested at  http://www.javaworld.com/javaworld/jw-09-2004/jw-0906-unicode_p.html -- caused another web-app error, resulting in it not being loaded.
    *setting the form attribute accept-charset -- resulted in no improvement.
    Right now I'm half desperate and half fed-up. Is this a common problem with MySQL? Should I use another database? Or perhaps it is the Connector/J Driver that's messing things up.
    I'll appreciate any help I get greatly.

    Hello. Maybe not so interesting after a year to try to ask did you ever get a final solution to that problem in command line perspective. OR does somebody else knows solution to this problem.
    Anyway I have similar problem, I use mysql5 with latin1 charset and I can insert to my database letters ��� normally via mysql command line and they show perfectly. But the problem is my web application.
    I can insert all characters to database and retrieve them normally via web app but if i need to use mysql command line for queries it fails because those special letters appear something like ��. I still need to make queries on mysql command line as admin. I have also tried to change different drivers like
    Class.forName("org.gjt.mm.mysql.Driver"); or
    com.mysql.jdbc.Driver etc connector is 3.0.17
    I have also tried to change to utf-8 and then changed mysql def.enc to same... i have used request.setWHATEVER CHARSET.....i'm out of ideas... help?

  • Select from table and Update to a view

    Hi,
    Can anybody let me if this is possible.
    I have a Master(single record)/detail(multi record) form. I would want to query/select the details from the base table but when I update/delete I would want to update/delete the details to a view.
    Is this doable?
    Thanks
    KAvitha

    Hi Kavitha,
    Solution 1 :-
    Why cann't you trap the ON-TRIGGERS (like ON-INSERT /On-update/ON-DELETE) of that block and put your piece of code to update/delete the view.
    SOlution 2 (I didn't try this ,so please try)
    I am not sure whether it will help you but can try !!Sorry if not working and let me know if you have a solution
    Create a package with Insert /Update/Delete sub procedures which does DML on view (as per ur requirement).
    Call this Procedure on DML Target Name of Advanced Database .
    Regards

  • How To Update A Table View From Client Side !!!!

    Hi I would like to update a table view from the Client Side. So that the user can keep updating the relevent data on the client and when they have finally finished they can press Save so the entire page is then sent to the Server.
    Does anyone know how to do this, I guess u have to use the EPCM, I have just started on it and would really appreciate some Help.
    Thanks,
    Emmanuel.

    This is what I found :-
    There are a couple of ways to approach this.
    1) load the excel spreadsheet into the database "as is". You can use interMedia
    text to convert the .xls file into a .htm file (HTML) or use iFS (see
    http://technet.oracle.com/
    for
    more info on that) to parse it as well. InterMedia text will convert your XLS
    spreadsheet into a big HTML table (easy to parse out what you need at that
    point)
    2) Using OLE automation, a program you write can interact with Excel, request
    data from a spreadsheet, and insert it. Oracle Forms is capable of doing this
    for example as is other languages environments. In this fashion, you can remove
    the "manual" and "sqlldr" parts -- your program can automatically insert the
    data.
    3) You can write a VB script that uses ODBC or Oracle Objects for OLE (OO4O) in
    Excel. This VB script would be able to put selected data from the spreadsheet
    into the database. We would recommend OO4O. It provides an In-Process COM
    Automation Server that provides a set of COM Automation interfaces/objects for
    connecting to Oracle database servers, executing queries and managing the
    results. OO4O is available from
    http://technet.oracle.com

  • Data not updating in database

    Friends i have table and i have created a sequence on basis of that table.
    For 1st page i have created an html region and made few items there and a save button.
    I am filling data to the fields in page 1 and clicking the save button. In save button i have passed the address of the items of 1st page to items of 2nd page which contains the same field of page 1 and few more additional field.
    the 2nd page which i have made is on basis of form on a table or view and taken exsisting sequence there. When i clicking the submit button in page 2 it is not updating my database and throwing error called unable to fetch row. Any suggestions on this?

    Lev addition to this i wanted when my create button in 2nd page get clicks my database gets updated and also a query runs which checks the same data of combination variant_type,model_code,year_manuafacture. It means if i have 2 records in database with same variant_type,model_code,year_manufacture then in the field how_many in page 2 count of 3 gets updated and the other field solution avaiable get updated with Y.
    For this in my local system in page 2 i created a plsql process and wrote this code and applied it with create button but its not working. Any idea where i am failing?
    Declare
    l_how_many Number;
    l_sol_av Varchar2(1):= NULL;
    Begin
    select count(*)
    into l_how_many
    from quality
    where 1=1
    and variant_type= :P2_VARIANT_TYPE --'Road Bike'
    and model_code = :P2_MODEL_CODE --'6'
    and year_manufacture= :P2_YEAR_MANUFACTURE  ; --'2000'
    If l_how_many=null then
        l_sol_av := 'N' ;
    else
        l_sol_av := 'Y';
    end If ;
    :P2_SOLUTION_AVAILABLE := l_sol_av;
    :P2_HOW_MANY_RAISED       := l_how_many;
    Exception
        when no_data_found then
        null;
    end;

  • Business Components and Database Views - Trouble Creating

    I am trying to create a business component that contains a View that I created in my database. When I get to the fnnal step of creating the business component and it begins to generate the XML and Java code, it bombs out and says that the view object does not support ROWID. I just need to select only GridControl of this view.
    Any suggestions/help would be appreciated. I could not find any info in the JDeveloper help.
    null

    Some options:
    [list]
    [*]Create the entity using the Entity Wizard instead of reverse engineering it from a table. In the entity wizard you can specify the table/view name, then indicate which attribute should function as the primary key.
    [*]Don't bother creating an entity object for this view. You can just create a view object with an "expert mode" query that selects against your database view. It does not need an entity object. Note, however, that without an associated entity you won't get "uniquing" of entity level values, so if another view object being used by the same use changes the data that this grid is showing, the updates won't be automatically synchronized if you go this route.
    [list]

  • Polling from the database view in BPEL 11g

    Hi,
    We do have a requirement of polling from the database view in BPEL 11g. I am exploring the following polling strategies in our case:
    - Delete
    - Logical Delete
    In case of Delete polling strategy, can we delete the record as the view does not allow deletion. In this case, do we have any other way to achieve this functionality?
    In case of Logical Delete, We have to mark the status column with particular value. how could we achieve the same when the view is not updateable.
    In 10g, we can override the delete polling strategy with an update statement. Is it possible in 11g?
    Thanks & Regards
    Siva

    Hi,
    I am also doing the same thing what you have done, please help me.
    I have used BPEL export utility for exporting my JPDs to BPEL. but it was not a good help, ultimately i m creating a process manually.
    the main problem what is the replacement of control(jcx files)
    please guide me really it would be great help..
    Thanks in advance and hope to hear from you.
    my mail id is [email protected]
    please send some document if you have...

  • Constant failures in setting up scalable wordpress. Update ClearDB database failed.

    I've been having Constant failures in setting up scalable wordpress with no luck on finding a fix. 
    Update ClearDB database failed is the most common issue, with Update deployment being the second issue. I though maybe it had to do with Azure changes over the last few months (beta portal), but have yet to successfully deploy a site. 
    Any suggestions / fixes would be greatly appreciated. 
    Also, i've tried utilizing the support link but it seems to hang perpetually (regardless of browser) when checking my subscription. 

    Hi,
    Two points need confirmed:
    1.Have you already purse the ClearDB database?
    2.What's error did you encounter when you scalable WP site?
    Regards,
    Will 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Commit isn't updating a database column

    I've got an ADF/UIX application that has a Commit button. If added a column to the database, and have propagated the schema change through my model and view controller. The new text field displays the data in the database, but the Commit button doesn't update the database with any user changes. Changes in the original data fields are committed, but not the new field that I've added.
    What do I need to modify in my ADF/UIX application so that the Commit button adds the new data field in it's update action?

    Does it work in the application module tester?

  • THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY

    THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY IN OBIEE DASHBOARD(ANSWERS)
    UNLESS AND UNTILL I OPEN THE ORACLE BI ADMINISTRATOR TOOL AND DO UPDATE ALL ROWCOUNT AND THEN SAVE THE RPD.
    WHERE AS ORACLE DATABASE TABLE DATA IS AUTOMATICALLY REFRESHED.
    PLS SOMEONE HELP OUT IN THIS ISSUE.

    Check whether you have enable cache on that view?

  • Updating XML thru view table

    Given the following view table that i created
    CREATE OR REPLACE VIEW PO_DETAIL_VIEW ( PAYLOADID,
    ORDERNUMBER, LINENUMBER, SHIPPEDITEMQTY, COST,
    ORDEREDITEMQTY, ACTION, UOM, DESCRIPTION,
    SKU, STATUS, CURRENCY, PLANNEDRECEIPTDATETIME
    ) AS select extractValue(value(p),'/OrderMessage/MessageHeader/@payloadId'),
              extractValue(value(p),'/OrderMessage/Order/@orderNumber'),
              extractvalue(value(i),'/OrderLine/@lineNumber'),
    extractvalue(value(i),'/OrderLine/@shippedItemQty'),
    extractvalue(value(i),'/OrderLine/@cost'),
    extractvalue(value(i),'/OrderLine/@orderedItemQty'),
    extractvalue(value(i),'/OrderLine/@action'),
    extractvalue(value(i),'/OrderLine/@uom'),
    extractvalue(value(i),'/OrderLine/@description'),
              extractvalue(value(i),'/OrderLine/@sku'),
              extractvalue(value(i),'/OrderLine/@status'),
              extractvalue(value(i),'/OrderLine/@currency'),
              extractvalue(value(i),'/OrderLine/@plannedReceiptDateTime')
    from PURCHASEORDER p, table(xmlsequence(extract(value(p),'/OrderMessage/Order/OrderLine'))) i
    when i executed the following command:
    UPDATE po_detail_view
    SET ORDERNUMBER = '500001' where PAYLOADID='1'
    I get end of file error which disconnect me from my oracle database.
    but when i update my another view table it is fine.
    CREATE OR REPLACE VIEW PO_MASTER_VIEW ( VERSION,
    PAYLOADID, TIMESTAMP, SENDERNAME, SENDERCOMPONENT,
    DOCUMENTREFERENCEID, SINGLETRANSACTION, INDEX0, INDEX1,
    INDEX2, INDEX3, CLOSED, ORDERNUMBER,
    ORDERTYPE, UNIQUEBUSINESSKEY, HANDLINGCODE, BUYERID,
    BUYERPARTYNAME, BUYERROLE ) AS select extractValue(value(p),'/OrderMessage/MessageHeader/@version'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@payloadId'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@timeStamp'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@senderName'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@senderComponent'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@documentReferenceId'),
    extractValue(value(p),'/OrderMessage/MessageHeader/@singleTransaction'),
    extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[1]/@content'),     
    extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[2]/@content'),               
    extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[3]/@content'),
    extractValue(value(p),'/OrderMessage/MessageHeader/HeaderIndexedAttribute[4]/@content'),
    extractValue(value(p),'/OrderMessage/Order/@closed'),
    extractValue(value(p),'/OrderMessage/Order/@orderNumber'),
    extractValue(value(p),'/OrderMessage/Order/@orderType'),
    extractValue(value(p),'/OrderMessage/Order/@uniqueBusinessKey'),
    extractValue(value(p),'/OrderMessage/Order/@handlingCode'),
    extractValue(value(p),'/OrderMessage/Order/Buyer/@Id'),
    extractValue(value(p),'/OrderMessage/Order/Buyer/@PartyName'),
    extractValue(value(p),'/OrderMessage/Order/Buyer/@Role')
    from PURCHASEORDER p
    UPDATE po_master_view
    SET VERSION = '2.0' where PAYLOADID='1'
    i can see that the problem lies with
    table(xmlsequence(extract(value(p),'/OrderMessage/Order/OrderLine'))) i
    is there any better way or solutions to work ard with it?
    Thanks.

    Thanks Mark,
    That's what i suspected the case, will log the itar later when i am free.
    Actually my main issue is that I am using forms 9i to view and edit the view tables that are based on the xml schema. Forms is giving me problem in accessing complicating views.
    I think my only solution is to:
    1)create a custom table updated by the view table.
    2)Create my form block based on custom table.
    3)update the xml data using updateXML() from the custom table.

  • Objects missing in database (views)

    As information/background, I have been away from SAP and basis for about four years.  Due to personnel changes here, I am now returning to it. While I was away, our SAP system was upgraded from version 4.0B to “SAP R/3 ENTERPRISE 47X110”.  I was not a part of the upgrade and have no details as to how it was accomplished.
    At this point, we have two SAP “systems”: DEV and PRD and they are on separate partitions of an i5 520.  Both are running on OS/i5 V5R3M5 with mostly updated CUMe packages, etc, and PASE is installed.  Both of these “systems” use the 6.20 kernel at patch level 1598.  We know that this is an OLD kernel and we need to upgrade.  I am currently planning the kernel upgrade to 6.40.
    In our PRD instance, using transaction DB02 I have been seeing that we are  missing  four views in the database:
      Views
        SYSTRIGCOL    Obligatory Base object is missing in DB
        SYSTRIGDEP    Obligatory Base object is missing in DB
        SYSTRIGGERS   Obligatory Base object is missing in DB
        SYSTRIGUPD    Obligatory Base object is missing in DB
    Is this a big deal?  Should I worry about it or just continue with my kernel-upgrade planning?
    If needed, can I just retrieve the source from the DEV instance, modify the source, and create the views in PRD? 
    I have confirmed that I can retrieve the DDL source from DEV via iSeries Navigator.  It would then just be a matter of copying it, modifying it for PRD, and then executing it for PRD.
    Thanks in advance for any advice.
    Robert

    Hi Robert,
    no this isn't critical during daily business, at least not in base release 6.20.
    You are missing a couple of system catalog views providing SQL trigger information on a schema basis. (They are views on top of the systemwide cross reference files.)
    I've seen this happening if you restore a library from an old OS/400 release (that did not know about those views) to a newer release.
    SAP does not use triggers in 6.20 during daily business that's why it is not critical.
    It's easy to fix though: You may consider removing all system catalog logical files from your R3<sid>DATA schema (WRKOBJ, 4) according to the following list:
    http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/db2/rbafzmstcatalogtbls.htm#catalogtbls .
    The following command will recreate them:
         CALL QSYS2/QSQXRLF PARM(CRT R3<sid>DATA)
    Hope that helps!
    Best regards,
    Dorothea

  • Using Database Views in ADF

    Hi,
    There are Two Views in My Database and I need to join these Views as one new VO in my ADF app. (and then I need to join this VO with another entity in my app)
    I tried to make Entity object of those Views but it seems that you can not make an Entity out of a Database View (and it reasonable !)
    but how can I accomplish such scenarios ?
    JDeveloper : 11.1.1.6
    Thank you
    Shahab

    this is to poster.
    am not hijacking this thread., i had a question with frank.
    However, for CRUD operations this could soon become hairy.
    go by creating two entities. Dependent on what needs to be updated in the database, you then override the doDML method of the EntityImpl classes with calls to >e.g. stored proceduresthis is to frank.
    i need a confirmation for above statement.
    if a dbview involves more than 1 dbtable means say as example: 3 table means
    if i take a dbview as a single entity object means, how could i perform CRUD operation?it's not possible.. am right?.
    so only you are saying take 2 eo make it a view (access through eo object),do crud operation seperate beyind business need.
    so only you are saying become hairy

  • Migrating database views between instances

    I've discoverer folders based out of database views?(around 30-40) and i'm planning to migrate all the VIEW's from one instance to another
    I'm currently executing 1 by 1 and since, these views are growing in number with the requirements i was wondering if there a easy way/tool to achieve this.

    Hi
    In addition to the advice already given, are you also changing the owner for the views? If you are then you will need to update Discoverer to tell it who now owns them.
    Should you move a view from one schema to another, use this workflow to update Discoverer.
    1. Launch Discoverer Admin.
    2. Open the business area containing a view that had its owner changed.
    3. Right-click on the folder and from the pop-up select Properties.
    4. Click on Owner and from the list of users, select the new owner
    5. Click OK to return to the Folder Properties dialog box.
    6. Click OK to close the Folder Properties dialog box.
    7. Right-click on the folder again; and from the pop-up list select Refresh.
    8. As you only have one option, click Finish.
    9. Discoverer will now compare the data definitions for the object and hopefully you will have no differences.
    If you do have differences this means there is something different in the new view and you will have to determine what that is and then fix it.
    Does this help?
    Regards
    Michael

Maybe you are looking for

  • Error in Order as direct material with PPS activated

    Hi, Using SRM 7.0, EHP-1 activated PPS. Before activating PPS direct material scenario worked fine. After activating the PPS I getting the following error. No account assignment exists; enter an account assignment. Created new account assignment cate

  • Webutil installed but not working

    Hi friends, regarding webutil, I installed webutil as per manual.And add following line in my formwebcfg file. webUtilArchive=d:\oracle\9isuite\webutil\lib\webutil.jar,d:\oracle\9isuite\webutil\lib\jacob.jar. Then attach webutil .pll library in my fo

  • AIR 2.6 on mobile can't connect to FMS in RTMFP

    Hello, we have a problem with an AIR2.6 application on iOS and Android. We are unable to connect to a Flash Media Server 4.0 on RTMP but trying with RTMFP we don't received conection event (no eventes received). It's possible to use RTMFP on iOS and

  • Sizing Tool - Disks

    The sizing tool for SCOM 2012 states the following for a 500 Windows Computers and 100 Network Devices scenario: Role:  Operations Database Server, Operations Data Warehouse Server, Web Console Server & SQL Server Reporting Services Server Hardware: 

  • ITunes error message; please help!

    My wife is trying to download podcasts from her iPhone 5s to her Macbook ver. 10.6.8 ... but we keep getting this error message from iTunes: "The iPhone 'Virginia's iPhone' cannot be used because it requires a newer version of iTunes." a.  She has iP