Using INSERT with Multiple Tables

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Using INSERT with Multiple Tables

    After seeing different tutorials I have reached the conclution to hand code
    the insert page on my site since it has to update mutliple tables something
    that is hard to do with a server behaviour.

    I have a main table with data in it called tbMembers containing heaps of
    personal data.
    I have a second table called tbMembersExtra containing other member relevant
    data.

    tbMembers has a primary key called SysMemId
    tbMembersExtra has a primary Key called MemExtraID and foreign key called
    SysMemId.

    The data i want to insert is stored in session variables and NOT a form.

    Some data belongs in one table the rest in the other.

    Do i really have to have separate SQL insert statements to cater for this or
    can it be done using one SQL insert statement. I obviously want to store the
    relevant data without losing the relationship.

    Can someone put me on the right track for doing INSERTS as mentioned above
    into different tables?

    Thanks.



    Tim Mannah Guest

  2. Similar Questions and Discussions

    1. insert form data into joined tables...
      Hello All, I am trying to insert form data in to two joined tables. If Table 1 has a "ProductID" unique key and Table 2 has a numeric "ProductID"...
    2. Multiple Insert or Looping Insert
      I built an application on an Access DB that allows a dispatcher to log trucks in the field at their location as they call in. There are three...
    3. Insert into two tables from a single submit
      Folks: Is there a good refresher out there on this kind of shenanigan? (ASP, please) -- Murray --- ICQ 71997575 Team Macromedia Volunteer...
    4. update multiple records in multiple tables from one form
      hello I have been trying to run multiple update queries based on the data entered by user. Brief background: I am fetching data from various...
    5. insert data for two tables at same time?
      1 to many relationship tables first table - project number (auto), project name, Proj manager, proj date, proj description second table - project...
  3. #2

    Default Re: Using INSERT with Multiple Tables

    You have to construct an insert statement for each table. The exact code
    will depend upon the server language being used

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "Tim Mannah" <timm@diabetesnsw.com.au> wrote in message
    news:d5rljp$i72$1@forums.macromedia.com...
    > After seeing different tutorials I have reached the conclution to hand
    code
    > the insert page on my site since it has to update mutliple tables
    something
    > that is hard to do with a server behaviour.
    >
    > I have a main table with data in it called tbMembers containing heaps of
    > personal data.
    > I have a second table called tbMembersExtra containing other member
    relevant
    > data.
    >
    > tbMembers has a primary key called SysMemId
    > tbMembersExtra has a primary Key called MemExtraID and foreign key called
    > SysMemId.
    >
    > The data i want to insert is stored in session variables and NOT a form.
    >
    > Some data belongs in one table the rest in the other.
    >
    > Do i really have to have separate SQL insert statements to cater for this
    or
    > can it be done using one SQL insert statement. I obviously want to store
    the
    > relevant data without losing the relationship.
    >
    > Can someone put me on the right track for doing INSERTS as mentioned above
    > into different tables?
    >
    > Thanks.
    >
    >
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Using INSERT with Multiple Tables

    Hi,
    We have included this functionality in MX Kollection 3 - that is in
    beta right now. So - it's possible with server behaviors.

    If you want to take part in the beta - just contact me at
    [email]acostin@interaktonline.com[/email] and I will register you in about one week.

    Alexandru

    Tim Mannah wrote:
    > After seeing different tutorials I have reached the conclution to hand code
    > the insert page on my site since it has to update mutliple tables something
    > that is hard to do with a server behaviour.
    >
    > I have a main table with data in it called tbMembers containing heaps of
    > personal data.
    > I have a second table called tbMembersExtra containing other member relevant
    > data.
    >
    > tbMembers has a primary key called SysMemId
    > tbMembersExtra has a primary Key called MemExtraID and foreign key called
    > SysMemId.
    >
    > The data i want to insert is stored in session variables and NOT a form.
    >
    > Some data belongs in one table the rest in the other.
    >
    > Do i really have to have separate SQL insert statements to cater for this or
    > can it be done using one SQL insert statement. I obviously want to store the
    > relevant data without losing the relationship.
    >
    > Can someone put me on the right track for doing INSERTS as mentioned above
    > into different tables?
    >
    > Thanks.
    >
    >
    >
    --
    InterAKT Online - Dreamweaver extensions
    [url]http://www.interaktonline.com/[/url]
    Alexandru COSTIN Guest

  5. #4

    Default Re: Using INSERT with Multiple Tables

    I've an article on the subject that may be useful

    [url]http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=47[/url]

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  6. #5

    Default Re: Using INSERT with Multiple Tables

    I recommend using the Insert Behavior, then passing all the form values in a
    session variable to a second page.
    Then on the second page populate hidden form fields with the session
    variables. Use the same insert behavior for the 2nd table you want to insert
    to.

    Here?s the page to explain the set up to pass the session variable:
    [url]http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16516[/url]

    Here?s what you need to auto submit the form.
    <body onLoad="document.forms[0].submit()">

    Glitch808 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139