Inserting data from a view

Hi:
i'd like to create a view from 5 different tables and let the user insert data through a form based in that view. Does anybody know how to do this? when i try to insert data i get error saying it can't be done in non key preserved tables. Any idea how to do this?
Thanks.
Regards. Urko.

HI Urko,
There are some issues in forms created on views ,especially when the view is based on two tables and also when there are issues of "Key-Preserved Tables" so please wait till the point we are able to overcome these limitations.As the forms are based on the ROWIDs which are not there in these views there are some issues
in these cases.There are bugs filled for these issues but will take some time to actually fix them.
thanks
rahul

Similar Messages

  • Update data from a view

    Hi,
    trying to update data from a view with:
    - Company (table)
    - Products (table)
    In a form, the user wants to update
    e.g: both products.product_name and Company.company_name.
    Is there a way to update a view records built on 2 tables ?
    Any idea will be really appreciated
    Thks

    An other question on INSTEAD OF Trigger:
    Base Tables:
    1.
    SQL> desc pcs_companies;
    Name Null? Type
    COMPANY_ID NOT NULL NUMBER(12)
    COUNTRY VARCHAR2(350)
    COMPANY_NAME VARCHAR2(320)
    COMPANY_PHONE VARCHAR2 (320)
    COMPANY_FAX VARCHAR2(320)
    COMPANY_URL VARCHAR2(150)
    UPDATED_DATE DATE
    2.
    SQL> desc pcs_individuals;
    Name Null? Type
    INDIVIDUAL_ID NOT NULL NUMBER(12)
    COMPANY_ID NUMBER(12)
    FIRST_NAME VARCHAR2(320)
    LAST_NAME VARCHAR2(320)
    LOB VARCHAR2(300)
    JOB_ROLE VARCHAR2(300)
    TITLE VARCHAR2(300)
    GENDER VARCHAR2(3)
    EMAIL VARCHAR2(720)
    FAX VARCHAR2(720)
    PHONE_NO VARCHAR2(720)
    UPDATED_DATE DATE
    COUNTRY VARCHAR2(150)
    ADDRESS_1 VARCHAR2(720)
    ADDRESS_2 VARCHAR2(720)
    ADDRESS_3 VARCHAR2(720)
    CITY VARCHAR2(720)
    3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
    4.
    SQL> CREATE VIEW V_PCS_COMPANY_IND
    AS
    SELECT
       i.INDIVIDUAL_ID,
       c.company_id,
       c.country,
       c.Company_name,
       c.company_phone,
       i.Company_id indiv_company_id,
       i.gender,
       i.first_name,
       i.last_name,
       i.lob,
       i.job_role,
       i.title,
       i.email_address,
       i.fax,
       i.phone_no ,
       i.address_1,
       i.address_2,
       i.address_3,
       i.city
    FROM
      pcs_individuals i,
      pcs_companies c
    WHERE
      i.company_id = c.company_id
    5.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
    INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
    FOR EACH ROW
    begin
    update PCS_COMPANIES
    set
         Company_name = nvl(:new.company_name,company_name),
         company_phone = nvl(:new.company_phone,company_phone)
    where company_id = :new.company_id;
    update PCS_INDIVIDUALS
    set
         gender = nvl(:new.gender,gender),
    first_name = nvl(:new.first_name,first_name),
         last_name = nvl(:new.last_name,last_name),
         lob = nvl(:new.lob,lob),
         title = nvl(:new.title,title),
         email_address = nvl(:new.email_address,email_address),
    phone_no = nvl(:new.phone_no,phone_no),
         fax = nvl(:new.fax,fax),
         country = nvl(:new.country,country),
         address_1 = nvl(:new.address_1,address_1),
         address_2 = nvl(:new.address_2,address_2),
         address_3 = nvl(:new.address_3,address_3),
         city = nvl(:new.city,city)
    where company_id = :new.company_id;
    end PCMS_COMP_IND_UPDATE_TR;
    6.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
    INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
    DECLARE
    ID number;
    BEGIN
    INSERT INTO pcs_companies (org_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    INSERT INTO pcs_individuals (company_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    end;
    My question
    On point 6:
    Assumption:
    - Company_id is PK of pcs.Company and FK in pcs.individuals
    - It should be feed by sequence (v_pcs_comp_id_seq)
    Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
    Thks for any advice,
    lamine

  • Cannot insert data from local database into remote database using subquery

    I have two oracle databases on different host.
    One is version 8i in Host A and the other is 9i in Host B.
    First, I try to create a dblink in 8i to 9i, but it fail.
    Then, I create a dblink in 9i to 8i, it success.
    I have already tried some select statement in 9i to view the table in 8i, which is success and that means the dblink is really work.
    The sql statement is like
    Select * from table1@hostA
    Then I have tried running some INSERT statement in 9i, which is copy data from table 1 in 8i to table 2 in 8i, both tables are in 8i. The sql statement is like
    Insert INTO table2@hostA(field1, field2)
    select field1, field2
    from table1@hostA
    This also success.
    Also, I have tried to use the following INSERT statement
    Insert INTO table2@hostA(field1, field2) values ('XXX', 'XXX)
    This also success.
    However, when I try to insert data from table in 9i to table in 8i using the following INSERT statement, it failed.
    Insert INTO table2@hostA(field1, field2)
    select field1, field2
    from table1
    The statement can execute, but all the rows inserted with every field value equal to NULL. I have tried to run the select part, it can return the data. But when I run the INSERT statement above, the value inserted into table2 is all equal to NULL.
    One more thing, I discover that the databases are using different NLS_CHARACTERSET
    9i is AL32UTF8
    8i is WE8ISO8859P1
    Is this relevant to my problem?
    Does anyone know the solution about this problem?
    Thanks!!

    How is the best way to do this ?How much are you planning to send?
    You can use COPY command. Ensure that you have valid database link between two databases.
    Available options are:
    create - creates a new table. errors out if the destination table exists.
    replace - drop the destination table and re-creates with data.
    insert - inserts data if the destination table exists.
    append– appends data into an existing table.
    use set arraysize 5000 -The arraysize specifies the number of rows that SQL*Plus will retrieve from the database at one time.
    copy from scott/tiger@ORCL to scott/tiger@ORCL92 create new_emp using select * from emp;

  • Is it possible to retrieve the data from maintainance view?

    Hi experts,
    Am facing one problem.
    Is it possible to retrieve the data from Maintainance View ,If yes how?
    IF it is not possible then Y?
    While am trying to retrieve data from maintainance view it's showing message like
    "it is not a database view or table".
    Can u pls give me ans.
    Thanks&Regards,
    Arun.

    Hi Arun,
    It is not possible to retrieve the data from Maintenance view. Maintenance View is different and Database View is different.
    Maintenance view : Maintenance view permits you to maintain the data of an application object together.The data is automatically distributed in the underlying database tables.
    A standardized table maintenance transaction is provided (SM30), permitting you to maintain the data from the base tables of a maintenance view together.
    In other words, Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.
    Database View: Data about an application object is often distributed on several database tables. A database view provides an application-specific view on such distributed data.A database view is automatically created in the underlying database when it is activated.Database views implement an inner join.If the database view only contains a single table, the maintenance status can be used to determine if data records can also be inserted with the view. If the database view contains more than one table, you can only read the data.
    Database views should be created if want to select logically connected data from different tables simultaneously. Selection with a database view is generally faster than access to individual tables. When selecting with views, you should also ensure that there are suitable indexes on the tables contained in the view.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Inserting data into relational views of object tables

    I hope someone could help me to solve the following problem:
    I would like to design an object-relational database in O8i. Unfortunatly the client-software (GIS) can only understand relational data (except the object type 'geometry'). So I created relational views on my object tables. But now it is not possible to insert data in those views. Do I have to create triggers on those views for inserting data ???
    Nevertheless: Updating data in views makes no problems.
    Thank you for reading this and I look foreward to hearing from you soon.
    Christian Heil

    Hi Mohammed,
    I guess following is your requirement
    List1 tile is attached to "BOList1". On button press you wanted the data to be persisted to Business object "BOList1History"
    I assume that you have created "BOLIst1History" properly by associating a write Bdoc etc etc.
    Write a method in Business object "BOList" called ZUpdateHistory. This new method should contain code for creating an instance of "BOLIST1History" and fill the property values as per your requirement. Call this method from the Button press event as follows
    anchor.bo.ZUpdateHistory
    Hope this helps
    Regards
    Ganesh Datta

  • Reading data from maintainance view

    hi ,
    Can we read the data from maintainance view through select statement.

    Hi again,
    1. V_001K_K
       Since this view comprises
       more than 1 table
      T001K
      T001
      It gives this error.
    2. Maintenacnee views comprising only 1 table
       can be used in Select.
      For eg. V_T001
      V_T003 = Not allowed
    PS:
    3. The reason for this is :
       Any R/3 view having only one table,
       for such view, a physical view is created
       in the database.
       The records in it can be modified, inserted,deleted.
       (conditions apply)
       But for view having 2 or more tables,
       no physical view is there in the database.
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • Is possible to represent data from a view in MapViewer?

    I have tried to represent data from a view instead a table with the Java-Beans API but I couldn't beacause it doesn't represent any geometry referenced by the view. I think it should be implemented because is very common to use views. Are there any way to represent them in MapViewer?
    Thanks.

    Like a table, you also need to register the view in spatial metadata (user_sdo_geom_metadata). Did you register the view and its spatial column there?

  • Why do we get the data from a view to a report.

    hi
    why do we get the data from a view to a report. is it possible to get the data from a view in all the cases?

    hi Jyotssna,
      Suppose you are planning to get the data from multiple tables then you got to specify seveal condtions and make use of joins which results in poor performance in fetching the data . In order to improve the performance we make use of views where the conditions of different tables are defined and the data is fetched accordingly.
    Regards,
    Santosh

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

  • How Can i Read data From Maintainance View

    I Want read data from Maintainance View. i written select query
    SELECT *
    FROM J_1yyyyV
    INTO TABLE GT_BUSPLACE.
    WHERE BUPLA = LV_BUPLA.
    this is giving following error
    "J_1yyyyV" is not defined in the ABAP Dictionary as a table,
    projection view, or database view.
    Can you help me Please.
    Thanks in Advance.
    Regards,
    Raj.

    Hi raj,
    maintainance view is a nothing but combinations of table using join on some fields..
    see the relation ship between the joins..
    if you want to write selection query ..go to se11 -->enter view name >and open tab>
                    Table/Join  conditions--> see the table's involved and join conditons between tables.
    and write the select query same as like the Table/Join  conditions in se11..now you can acheive the
    table maintainance fields..
    Prabhudas

  • How to extract data from maintenance view

    Hi experts,
    How can I select the data from maintenance view. As you know select query doesn't work on the maintenance view. And View name will be known at run time only.
    Thanks
    Yogesh Gupta

    > Let me tell you that I am a SAP certified ABAP consultant having experience of 4.5 years.
    I suspect that we will be hearing more comments about that.
    > Whatever question I asked can't be replied with the basic training (if yes please tell me even one).
    Debugging a macro?
    Another one => FM or BAPI to create the Activity Group in 4.0B No answer is possible? You have to be joking!
    And in How to get email ID fo a SAP user you obviously didn't even try Graham's answer!
    > I closed some of the answered questions since I didn't get the answers for them for a long time and SDN site doesn't allow to keep more than 10 questions open.
    The "comment field" is not mandatory. You don't need to flood the forum with your questions again.
    > I do respect your  concerns but I have no intention to abuse this site as it has been very helpful for me.
    That is the most important part. Thank you. But you seem to be unaware of the "search" functionality.
    If you can imagine that you are not the first person to ask a certain question, then you can be sure that someone else already has and you can find the answers on your own. If you still have doubts, then ask a specific question providing the details.
    Based on your other questions, you are on release 4.0B. Is that still correct?
    Cheers and thanks for responding,
    Julius
    Edited by: Julius Bussche on Jan 23, 2009 12:06 AM

  • How to retrieve data from a view.

    HI,
    I want to retrieve the values of the <b>Field MNTXT from the view V_T530</b>.
    Please let me know how i can retrieve data from this view.The Select statement doesnt work on a view.
    Regards,
    Bhavika

    Hi kumar,
    By using select stattement you can fetch from view. 
    Here viaufkst is view.
    For it is working. please check.
    select (g_selfields_tab) from viaufkst
              into corresponding fields of table order_itab
                       for all entries in order
                              where                "(g
                              aufnr in order and
                              equnr in equip and
                              priok in prior and
                              iphas = '3' and
                              ilart in acttyp and
                              qmnum in notif and
                              werks = plant and
                              auart in ortyp and
                              getri in date.
    please try.
    with Regards,

  • How to extraxct  data from a view.

    hi,
        i'm tying to extrct data from a view vbdka, with select. but i;m getting a syntax error that it anot a DB Table or DB view, pls tell me how to extract data from that view.
    thanks.

    hi,
    just check out if u have declared the table or not n see if it is not a structure also
    madhuri.

  • How to extract data from generic view and function module

    hi experts,
    can anybody give me the steps to extract data from generic view and  functon modules.
    thanks and regards
    venkat

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    https://websmp103.sap-ag.de/~sapidb/011000358700007535452002
    Hope it Helps
    Chetan
    @CP..

  • Trying to query data from a view - ORA-01882 and ORA-02063 Errors

    Hey there,
    I tried to query data from a view that was provided by a colleague. This view works fine and gives correct data using PL/SQL Developer or SQLPLUS, but in SQL Developer, I get the following error:
    ORA-01882: Time zone region not found
    ORA-02063: preceding line from SYSTOOLS
    01882.00000 - "timezone region %s not found"
    * Cause: Specified reason name was not found
    * Action: Please contact Oracle Customer Support
    Vendor Code 1882
    Where comes this error message from?! SYSTOOLS is the database link.
    Can't see an obvious reason for this error.
    OS is Windows 2000 SP4, SQL Developer is v1.1.1.25 BUILD MAIN-25.14
    Regards,
    Thomas

    From Oracle Messages 'Cause and Action'
    http://www.oracle.com/technology/products/designer/supporting_doc/des9i_90210/cmnhlp72/messages/ora_messages.htm
    ORA-01882, 00000, "timezone region %s not found"
    Cause: The specified region name was not found.
    Action: Please contact Oracle Customer Support.
    Maybe invalid region in NLS_LANG?
    "select * from v$nls_parameters"
    Starting this script in all developer program and compared result...

Maybe you are looking for

  • Does anyone know how to show the year in the menubar?

    I've never been able to do this. YouControl.app did do it but sadly the developer is no longer supporting it.

  • Using music files from DVD

    Hey everyone, I was wondering how I would be able to "rip" the music files from a Dvd. I own the Korn Greatest Hits which includes a bonus DVD of their live concert at CBGB's. I absolutely love it, but I do not know how to take the audio files off of

  • Problem in iBooks 3.2 with position absolute in iOS 7.0.4

    We are positioning in a reflow-able ebook a "div container" via "position absolute". The position of the div container is changed via "translate3d". Everything work fine in iOS 5.1.1 / eBooks 3.1 and iOS 6.1.3 / eBooks 3.1. But in iOS 7.0.4 / iBooks

  • Why don't the photos load properly

    When i scroll through my photos in my library (in loop mode) why don't the photos load properly and the photos still blurred?

  • Iphoto style albums via scripts?

    I believe it's possible to create a script to allow searching of multiple drives and, or adding images from multiple sources into collections which remain intact rather like those in iphoto? image albums rather than just volatile saved searches or du