SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Insertion using views in MySQL MAX.

    Can a record be inserted into a view?

    If it can, will inserting a record cause MySQL MAX to distribute the values correctly into the related tables?

    So if I have the following view:



    book


    ====
    author_name
    author_last_name
    publisher
    title

    Pulling from related tables:





    author

    =====
    id
    name
    last_name

    book
    =====
    id
    title

    publisher
    ======
    id
    name
    number

    will doing:





    INSERT INTO all_books (author_name,author_last_name,publisher,title) VALUES ("John","Smith","Barnes and Nobles","Book title")



    ...insert "John" into author.name, "Smith" into author.last_name, "Barnes and Nobles" into publisher.name and "Book title" into book.title while setting the appropriate FK?



    Hope I explained it right...

    Thank you,
    Luis

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    yes, you explained it fine

    i don't think any database does that
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •