SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    INSERT data INTO two different table at once.

    Is that possible. Have a costumers and product tables. at some point in the code it will have a Statement that will retrieve data from both table through a link table call costupro table with a costumer_id and product_id field. Now at the moment a costumer wants to insert data it is obvious that both tables costumers and product table will be used by the costumer to insert data in both. How a insert statement to two different is approached?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,263
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by co.ador View Post
    How a insert statement to two different is approached?
    one at a time

    and by the way, it is customer (a patron; one who purchases or receives a product or service from a business or merchant), not costumer (a person who designs, makes or supplies theatrical costumes; a costumier)

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you r937

    I still have some miss spelling words to manage....

    In my own humble opinion I think they should make the INSERT as the SELECT, the SELECT is capable of building longer statements.

    thank you again I am going to go one at the time by now.


Bookmarks

Posting Permissions

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