|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Can Foregin Keys be added to INNODB tables after the have been created.
All,
I have two tables in a database, that have a primary keys (id_num) that are identical. The tables created successfully via a GUI interface I was using, however there was no option for setting up a foregin key to link these tables. I read about a command that would allow presxisting tables to be linked via foregin keys from the MySQL website, however for a newbie like me, I did not understand the concept behind it. Anyone have some ideas for a DB dummie like me? Thanks, Tom |
|
#2
|
||||
|
||||
|
ALTER table command is what you are after.
http://www.mysql.com/doc/en/ALTER_TABLE.html Although wether MySQL finally supports relations through foreign key/primary key in proper select * from table1 t1, table2 t2 where t1.pk = t2.fk is a different question. Since they support innoDB natively since 4.0 I assume they do, but don't be supprised if they still require you to use inner join. AFAIK phpmyadmin (or whatver it is called) does not support innoDB. |
|
#3
|
|||
|
|||
|
MySQL question
Merlin,
Thanks for the heads up. I'm a real newbie to MySQL so my learning curve bits. Your information will start me in the right path. Thanks, Tom |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Can Foregin Keys be added to INNODB tables after the have been created. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|