Using a single Form to Update two tables.

I would like some assistance please?
I have an "<strong>Event</strong>" ,"<strong>Item</strong>" and "<strong>Item allocation</strong>" tables . The "Item_allocation" table serves as a composite table joining the "Item " and "Event" table. The relationships are as follows (*1*)Event :(*M*)Item and vice versa. * hence the reason for the third table.
Attributes are as follows.
<u>Event</u>
Eventid(pk)
Eventname
Eventdate
<u>Item</u>
Itemid(pk)
Itemname
Itemcost
Itemallocation_
Item_allocationid(pk)
Eventid(fk)
Itemid(fk)
<strong><u>What I'm essentially trying to achieve here is , allow the user to book and event and as part of that process be able to select multiple items.. I need the both "Event " and "Item_allocation" tables to be updated.</u></strong>
Thank you in advance.

Hi,
Try creating the form based on a view and use an INSTEAD OF trigger to create the records in the two tables. Here's an example of this: Report & form on Multiple table
Andy

Similar Messages

  • How to use one form to update two tables

    How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
    So, what is the proper way to update two tables with the same form fields?

    Hello Vikas,
    "The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
    Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
    For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
    Regards,
    Arie.

  • Single form to update multiple tables

    Hi,
    I have a strange request but I hope it makes sense.
    I have to create a front end to maintain roughly a 100 tables, this will increase to about 200 in the future. I have no control over the table structure so this is what I am stuck with.
    I could create a tabular form for each table but this would mean that each new table that comes on line I would have to add another page
    So rather than doing this what I thought was having one dynamic tabular form where the column headings would come from the table / column headings and the form get / update would be dynamically created. One problem I cant guarantee the tables will have the same number of columns.
    So the user from a drop down list could select a table name and that table will be displayed in a tabular report, they select another table from the drop down list and that table is displayed on the same page.
    That way there would be only one form and I could add a page where the users could add additional tables to be used by the app as they become available
    Is this possible using apex?? Has anyone done anything similar before and if so are there any pointers or examples they could give me.
    Hope this makes sense
    Thanks in advance

    Hi,
    Thanks for this, it is what I'm after and part from the add row functionality I think I have a working version.
    The next thing I have to do is make it work with tables with different numbers of rows, do you have any tips or hints on how best I can achieve this??

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • Two forms that update differrent tables on the same page?

    I tried to add two forms that update different tables on to one page.
    Problem is when I do that the forms gives me an error saying the field does not exist. It's like it is trying to update one table with the other tables fields.
    As an example Say I have one forms that is for people table and another one that is the Jobs table.
    When I go to update the people table, it sends the data for the jobs fields too I get an error like the field job description does not exist.
    I have two different forms for these and everything.
    I would hope it is possible to have two forms that update different tables on the same page.

    I was trying the exact same thing, but i managed to work round it by setting the steps to hide one region, so the user would enter the form see one region submit the region then direct back to the same page with the different region visible and the original hidden.
    I don't know if this would be acceptable for you...

  • Detail tabular form based on two tables

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
    table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
    but the problem is about saving data , i can not save the data , i think
    because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
    Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
    so
    what should i do to save the data ? should i create another "mru" process based on the other table or what ?
    thanks

    Anything beyond "simple" requires that you do it yourself.  I believe that what you want is "beyond simple"
    As far as I know, you can only use the 'mru' on one table.
    (I could be wrong)
    If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
    ie CREATE VIEW on the two tables.
    However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
    If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
    (lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
    personal note:  triggers have a really baaaddd habit of hiding code from other developers.  you are better off, in the long run, creating your own 'mru'..
    ie a package with procedures to handle INSERT, UPDATE, and DELETES
    MK

  • Updating two tables through JDBC

    <b>Hai,
    Can anybody please answer the following question?
    How can I update two table in Receiver by using JDBC Adapter at receiver side from single source structure.
    Thanks in advance.</b>

    Hi ,
    Create following structure for inbound data type to insert data in DB using JDBC receiver adapter here dbTableName1 is for first table and dbTableName2 for second table .
    <StatementName2>
    <dbTableName1 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName1> 
    <dbTableName2 action="UPDATE_INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    <access>
    <col1>val11</col1>
    </access>
    </dbTableName2> 
      </StatementName2>
    Thanks ,
    Suvarna
    pls award pts if it helps

  • Updating two tables at the same time

    Please,
    Does someone have an idea on how to update two tables at the same times?
    Thanks a lot in advance

    I was thinking about a single session and single update command.
    That's why I thougth someone else could have a clue.
    Thank you

  • Can you really update two tables in one SQL statement

    Ok a post in the forum has got me awefully curious:
    Can you update two tables in one update statement i.e something like this
    update table a , b
    set b.<column> = something
    a.<column> = something
    Something to this effect.
    If you are curious to know what post I am talking about it is called "updating a single row"

    No. You can only update one table in one SQL statement.

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • Updating two table from a single query

    I have two table such as
    user_log(user_id , password)
    and
    user_info(user_id , name , age , address , sex , email , contact)
    If I want to add data from a single form in php then what is the query?

    Hi,
    welcome to the forum..! plesae always post table data and expected result to help forum members help you better.
    From what I understand, all you need is a join on userid (assuming userid is unique/primary key )
    select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id
        ---- and any otehr condition for the user that you need.(where clause)In PHP......(based on this link.. http://wiki.oracle.com/page/PHP+Oracle+FAQ
    haven't tested the code.. )
    <?php
    $conn = oci_connect("scott", "tiger", "localhost/XE");
    if (!$conn) {
    $m = oci_error();
    echo $m["message"];
    exit;
    $stid = oci_parse($conn, "select ul.userid,
             ul.password,
            ui.name,
            ui.age
      from user_log ul,
              user_info ui
      where ul.user_id = ui.user_id");
    oci_execute($stid);
    // Query the table
    echo "<table border='1'>";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>";
    foreach ($row as $item) {
    echo "<td>".($item!==null?htmlentities($item):" ")."</td>";
    echo "</tr>".PHP_EOL;
    echo "</table>";
    oci_free_statement($stid);
    oci_close($conn);
    ?>Try to provide more details.. if this is not what you are looking for.
    Hope this helps,
    Rajesh.

  • How to use sp_msforeachdb with sp_rename for changing two table names in each databases-

    I have around 990 databases on a single SQL server in which I want to rename two tables 'AuditEvent' and 'AuditPropertyEvent' to 'AuditEvent_Archive' and AuditPropertyEvent_Archive table.
    Then I want to transfer lastest 6 months of data from now newly rename archived tables to New created Auditevent tables (Which will have same structure as old),
    For doing it I tried Cursor and SP_msforeachdb as possible solutions but its not allowing me to execute 2 sp_rename statements with go inside a dynamic statement.
    Please suggest any possible solutions on how to rename the 2 tables in all databases using sp_msforeachdb or cursor in a single go.

    exec sp_msforeachdb '
    USE [?]
    IF EXISTS (SELECT 1 FROM ?.INFORMATION_SCHEMA.TABLES WHER TABLE_NAME = ''AuditEvent'')
    EXEC sp_rename ''AuditEvent'',''AuditEvent_Archive''
    IF EXISTS (SELECT 1 FROM ?.INFORMATION_SCHEMA.TABLES WHER TABLE_NAME = ''AuditPropertyEvent'')
    EXEC sp_rename ''AuditPropertyEvent'',''AuditPropertyEvent_Archive''
    SELECT *
    INTO AuditEvent
    FROM AuditEvent_Archive
    WHERE datecolumn>dateadd(month,-6,getdate())
    SELECT *
    INTO AuditPropertyEvent
    FROM AuditPropertyEvent_Archive
    WHERE datecolumn >dateadd(month,-6,getdate())
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How To Update two tables at once

    Hi,
    I have to join two tables for an update. Is it possible to update both tables in one update statement? Thank you.
    UPDATE table_a a, table_b b
    SET
    a.name = 'Tom',
    b.city = 'New York'
    WHERE
    a.id = b.id

    Is it possible to update both tables in one update statement? That's not possible.

  • In ER DIagram using toad( how can i link two tables)

    Hi,
    Any Toad expert can guide me that how can i link two tables in Toad in ER Diagram to show the relationship between two tables.
    Thanks

    Hi,
    I hope there is foreign key relationship in tables, if so then you can click on "Find table dependencies" icon which will draw lines between them.
    ~Vinod

  • How can I update multiple rows in table using a single form button and checkboxes

    I have a project where the visitors can select multiple productos and once the click on the PURCHAS button it updates the selected records.

    You have not mentioned the programming language that you are using, but here's a link that could help you if you are using ASP.
    http://csharpdotnetfreak.blogspot.com/2009/05/edit-multiple-records-gridview-checkbox.html
    Also, have a look at this discussion thread
    http://forums.asp.net/t/1470882.aspx

Maybe you are looking for