The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ColdFusion Development
|
Joining Normalized Tables in Recordsets
Discuss Joining Normalized Tables in Recordsets in the ColdFusion Development forum on Dev Shed. Joining Normalized Tables in Recordsets ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 9th, 2004, 04:23 AM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 16
Time spent in forums: < 1 sec
Reputation 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
|

January 12th, 2004, 08:54 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
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.
|

January 12th, 2004, 02:34 PM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 16
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
What are the data types they could be? I thought they were all just text? All it is is a text DB.
|

January 12th, 2004, 06:34 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
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.
|

January 12th, 2004, 06:47 PM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 16
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Yeah, I just got a book. I'm on about page 2. Thanks for your help
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|