#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    16
    Rep Power
    0

    Joining Normalized Tables in Recordsets


    I'm trying to normalize my database, and I believe that I've done a decent job at it. My only problem is that I can't join them together in Dreamweaver. This is my very simple SQL statement:

    SELECT Title.Title, artist.ArtistID
    FROM Title, artist
    WHERE Title.ArtistID=artist.ArtistID

    Now I know basically nothing about CF, but shouldn't this make it so that the FK in my Title table (ArtistID) shows up as the PK in my Artist Table? I just have a simple table that basically has two columns, ArtistID and Artist, showing that ArtistID is an artist name, for example, 1=Aerosmith, 2=Sublime, etc... And in my Title Table, I just want to show that with a certain title, this # is the artist. It seems simple, but whenever I try it, I get a huge error with about 100 lines of error messages, the top one being "Type Mismatch in Expression." Am I going about this all wrong? I'm really new so be simple in your explanations, please.

    Thanks a million
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    From the error, a type mismatch, I'd look first at the data types of the columns in your tables, particularly the data types of your primary and foreign keys. They must be exactly the same.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    16
    Rep Power
    0
    What are the data types they could be? I thought they were all just text? All it is is a text DB.
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    hmmm, I'd say you might want to pick up a book on database design or do some reading on the topic on the web. There are numerous data types that a column can have in a database. Some RDBMS's support different types, but common ones are number, integer, fixed length character, variable length character (varchar), boolean, BLOB, etc.

    The data types of primary and foreign keys must be identical, and are often unique integers.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    16
    Rep Power
    0
    Yeah, I just got a book. I'm on about page 2. Thanks for your help

IMN logo majestic logo threadwatch logo seochat tools logo