|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Does this create the same table ?
CREATE TABLE score ( score integer REFERENCES bord (score) ); CREATE TABLE score ( score integer, FOREIGN KEY (score) REFERENCES bord (score) ); |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
gert wrote:
> Does this create the same table ? > > CREATE TABLE score ( > score integer REFERENCES bord (score) > ); > > CREATE TABLE score ( > score integer, > FOREIGN KEY (score) REFERENCES bord (score) > ); Just issue the command: SHOW CREATE TABLE score And you know... Best regards, -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Apr 11, 4:52 pm, Willem Bogaerts <"w.bogaerts'OR1=1--
"@kratz.maardanzonderditstuk.nl> wrote: > gert wrote: > > Does this create the same table ? > > > CREATE TABLE score ( > > score integer REFERENCES bord (score) > > ); > > > CREATE TABLE score ( > > score integer, > > FOREIGN KEY (score) REFERENCES bord (score) > > ); > > Just issue the command: > > SHOW CREATE TABLE score > > And you know... hmm i did somthing stupid again the second table gives me ERROR 1005 (HY000): Can't create table 'test.score2' (errno: 150) |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
ok i found out its totaly different and that a references of a foreign
key need to be a key ![]() The developers could gave a other error output doh telling me score is not a key |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
CREATE TABLE score1 (
score integer REFERENCES bord (score) ); CREATE TABLE score2 ( score integer, ); why does this show me the exact same create table ? CREATE TABLE `score1` ( `score` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE `score2` ( `score` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | |
|
![]() |
| Outils de la discussion | |
|
|