|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
What are the data types they could be? I thought they were all just text? All it is is a text DB.
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Yeah, I just got a book. I'm on about page 2. Thanks for your help
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Joining Normalized Tables in Recordsets |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|