key,
- vendorName VARCHAR(30) NOT NULL,
- featureName VARCHAR(30) NOT NULL,
- comment VARCHAR(100)) TYPE=INNODB;
mysql create table samDB.license_data(
- licenseID integer(5), index licID_index (licenseID), foreign key
licID_index (licenseID) REFERENCES samDB.license_info
I am just working on mySQL and create two tables, defined licenseID is
the primary key in license_info, and foreign key in license_data.
But I tested it didn't work the way as like in Oracle delete cascade or
update cascade.
Did I do something incorrect?
mysql create table samDB.license_info
Hello.
On Tue 2002-12-10 at 16:05:05 -0800, [EMAIL PROTECTED] wrote:
I am just working on mySQL and create two tables, defined licenseID is
the primary key in license_info, and foreign key in license_data.
But I tested it didn't work the way as like in Oracle delete cascade or
update cascade
vvM HI
vvM still not working :-(
vvM I didn't do the installation , Do we need to set any option
vvM specifically during the installation for foreign key to work??
The InnoDB is loaded ?
please run
show variables like '%innodb%';
and put here.
tnks.
sql,query
vinita,
Tuesday, November 19, 2002, 2:06:01 AM, you wrote:
vvM still not working :-(
vvM I didn't do the installation , Do we need to set any option
vvM specifically during the installation for foreign key to work??
Check that your both tables are InnoDB:
SHOW TABLE STATUS LIKE
:-(
vvM I didn't do the installation , Do we need to set any option
vvM specifically during the installation for foreign key to work??
The InnoDB is loaded ?
please run
show variables like '%innodb%';
and put here.
tnks.
sql,query
HI
I'm not sure what I'm doing wrong in the following example, the foreign
key is NOT working. I'm using ver3.23.53.
-
mysql CREATE TABLE unit (
- unitCode CHAR(20) NOT NULL
Change room to unit
FOREIGN KEY (unitCode) REFERENCES room (unitCode) ON DELETE CASCADE
FOREIGN KEY (unitCode) REFERENCES unit(unitCode) ON DELETE CASCADE
Hope this helps,
Sil
- Original Message -
From: vinita vigine Murugiah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, November
HI
still not working :-(
I didn't do the installation , Do we need to set any option
specifically during the installation for foreign key to work??
mysql CREATE TABLE unit (
- unitCode CHAR(20) NOT NULL,
- unitName CHAR(50),
- unitYear CHAR(20) NOT NULL,
- PRIMARY KEY (unitCode
Hello
I use Linux Red Hat 7.3 and MySQL-max version 2.23.51. I have one problem.
I created table:
CREATE TABLE Folders (
FOLDER_ID INTEGER NOT NULL,
FOLDER_NAME VARCHAR(50) NOT NULL,
PARENT INTEGER NULL,
PRIMARY KEY (FOLDER_ID),
KEY XIE1_Folders (PARENT),
FOREIGN KEY
Edouard, you have a foreign key referencing a column in its own table.
PB
-
- Original Message -
From: Serdioukov Edouard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 29, 2002 3:23 AM
Subject: InnoDB, Foreign Key
Hello
I use Linux Red Hat 7.3 and MySQL-max
From: Heikki Tuuri
To: Serdioukov Edouard
Cc: [EMAIL PROTECTED]
Sent: Tuesday, October 29, 2002 7:23 PM
Subject: Re: InnoDB, Foreign Key
Edouard,
I tested this on Linux using mysql-max-3.23.51, the .tar.gz distro. It
worked ok.
Are you sure you were using 3.23.51? Starting from 3.23.50, InnoDB
Christian,
- Original Message -
From: Christian Lizell [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Thursday, October 24, 2002 6:18 PM
Subject: Database in path to foreign key references
Hello!
Is there any way to get rid of the database name in the path
Hello!
Is there any way to get rid of the database name in the path to the
reference of a foreign key. When using mysqldump to copy a database
the name of the source database is in the path of the foreign key
reference. In my case, that is not what I want.
An example:
mysql use
Massimo,
- Original Message -
From: Massimo Petrini [EMAIL PROTECTED]
To: Heikki Tuuri [EMAIL PROTECTED]
Sent: Tuesday, October 22, 2002 8:32 AM
Subject: foreign key
There is a way to verify the foreign key ?
If I put in my dump then instruction
SET FOREIGN_KEY_CHECKS=0;
I can
Jungsu,
- Original Message -
From: Heo, Jungsu [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Saturday, September 28, 2002 9:34 AM
Subject: Problem on ALTER TABLE ... ADD CONSTRAINT FOREIGN KEY..
Hello.
I have a problem on ALTER TABLE ... ADD FOREIGN KEY.
I'm using
Hello, Heikki. Thank you very much for your reply!.
I Found the problem.
If I give FK name explicitly, ALTER TABLE FOREIGN KEY .. dose not works.
Example 1 - give FK name explictly #
mysql alter table CONS_CHILD ADD constraint foreign key CONS_CHILD_FK
Hello.
I have a problem on ALTER TABLE ... ADD FOREIGN KEY.
I'm using InnoDBs, and I wanna create Foreign Key after table has been created.
But, 'ALTER TABLE .. ADD FOREIGN KEY does not work.
Manual says :
The FOREIGN KEY, CHECK, and REFERENCES clauses don't actually do anything
And in my
Sorry, I missed PARENT's COLUMNs.
Corrects.
ALTER TABLE CONS_CHILD ADD FOREIGN KEY CONS_CHILD_FK ( A , B ) REFERENCES
CONS_PARENT(A, B ) on delete cascade ;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql SHOW
Hi!
According to the website MySQL 4.0.x supports foreign key constraints.
For version 4.1 foreign key integrity rules are planned.
What is the difference between these 2? On previous versions of MySQL it
was possible to create foreign keys but changed data was not replicated to
other tables
Remco,
Friday, September 27, 2002, 6:29:28 PM, you wrote:
RB According to the website MySQL 4.0.x supports foreign key constraints.
RB For version 4.1 foreign key integrity rules are planned.
RB What is the difference between these 2? On previous versions of MySQL it
RB was possible to create
At 17:29 +0200 9/27/02, Remco Barendse wrote:
Hi!
According to the website MySQL 4.0.x supports foreign key constraints.
For version 4.1 foreign key integrity rules are planned.
What is the difference between these 2? On previous versions of MySQL it
was possible to create foreign keys
It is supported in MySQL 4.0.x if you use the InnoDb table handler. I'm
not sure about 4.1.
Remco Barendse [EMAIL PROTECTED] 09/27/02 09:29AM
Hi!
According to the website MySQL 4.0.x supports foreign key
constraints.
For version 4.1 foreign key integrity rules are planned.
What
neal,
Tuesday, September 03, 2002, 4:06:37 AM, you wrote:
n Sorry for the MySQL newbie question ... but are there not primary/foreign
n key constraints in MySQL 3? I can't imagine that this is right. Perhaps
n I'm just overlooking something
Foreign keys constraints is supported in InnoDB
Neal,
Sorry for the MySQL newbie question ... but are there not primary/foreign
key constraints in MySQL 3?
In MyISAM tables or ISAM tables no.
I can't imagine that this is right. Perhaps
I'm just overlooking something
innodb?
(mysql query)
DSL
Sorry for the MySQL newbie question ... but are there not primary/foreign
key constraints in MySQL 3? I can't imagine that this is right. Perhaps
I'm just overlooking something
Thanks.
Neal
-
Before posting, please check
Kai,
Sunday, August 18, 2002, 1:53:32 AM, you wrote:
KV Just created a table with a column named client_nr that is a foreign key
KV referencing to my Clients table:
KV CREATE TABLE Contacts (
KV contact_nrint not null auto_increment,
KV first_namechar(30),
KV last_namechar(30),
KV
Just created a table with a column named client_nr that is a foreign key
referencing to my Clients table:
CREATE TABLE Contacts (
contact_nrint not null auto_increment,
first_namechar(30),
last_namechar(30),
client_nr char (30),
emailchar(30),
tel_1char(5),
tel_2char(30
Hi,
I just would like to ask that what are the following foreign key definition
extensions good for exactly?
I mean how does these SQL syntaxes work?
MATCH FULL | MATCH PARTIAL
ON DELETE/UPDATE RISTRICT/CASCADE/SET NULL/NO ACTION/SET DEFAULT
Thx,
Daniel
= InnoDB;
CREATE TABLE AChildren (
Id int unsigned not null auto_increment,
Parent int unsigned not null,
primary key (Id),
index Parent (Parent),
foreign key (Parent) references AParents (Id)
) TYPE = InnoDB;
//Section B
CREATE TABLE BParents (
Id int unsigned not null
a non-latin1 character set as the default
character set, then definition of foreign key constraints could fail in an
assertion failure in dict0crea.c, reporting an internal error 17.
...
Please upgrade to 4.0.2.
Heikki Tuuri
Innobase Oy
---
InnoDB - transactions, hot backup, and foreign key support
and they cannot be repaired (as I restart MySQL).
KD The crash appears when I create the second table with a foreign key
KD constraint.
KD Do I do something wrong or this is a real bug in InnoDB?
Do you use other than latin1 default character set? If so, this bug
was fixed in 3.23.49:
http
Heikki,
Yes, I'm using Hungarian character-set as default.
I've checked the mysql.err, and it contains nothing important.
The full content of mysql.err right after starting mysqld-max, runnig
the script and crash:
---
MySql: ready for connections
---
Maybe, because MySQL crashed before it
BKR,
you can have any number of foreign keys in a single table.
But you have not created the necessary indexes on foreign keys:
...
Both tables have to be InnoDB type and there must be an index where the
foreign key and the referenced key are listed as the first columns. InnoDB
does not auto
B.K.R.,
Saturday, July 13, 2002, 7:08:54 AM, you wrote:
BKRS The below mentioned sql makes an error when created
BKRS with two foreign key constraints under MySQL/Innodb
BKRS table type. Any help to solve this problem?
BKRS create table UserMenuRestrictions
BKRS (
BKRS CompanyCode
You shouldn't have a problem if you list each foreign
key separately, as follows:
foreign key (MenuName) references MenuDetails
(MenuName)on update restrict on delete restrict,
foreign key (MenuParentName) references MenuDetails
(MenuParentName)on update restrict on delete restrict,
That's how
Hi,
The below mentioned sql makes an error when created
with two foreign key constraints under MySQL/Innodb
table type. Any help to solve this problem?
create table UserMenuRestrictions
(
CompanyCodechar(10) not null,
UserId char(10
Chuck,
- Original Message -
From: Chuck Simmons [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Tuesday, July 09, 2002 4:29 AM
Subject: possible bug: alter table trashed foreign key constraints in innodb
sql query
In version 3.23.49a when using an innodb table, alter
Chuck,
Tuesday, July 09, 2002, 4:26:31 AM, you wrote:
CS In version 3.23.49a when using an innodb table, alter table appears to
CS corrupt foreign key constraints. Try the following test case:
It's described in the MySQL manual:
http://www.mysql.com/doc/S/E/SEC446.html
and fixed since
sql query
In version 3.23.49a when using an innodb table, alter table appears to
corrupt foreign key constraints. Try the following test case:
create table test_base (
base_id int not null,
primary key (base_id)
) type = innodb;
create table test_ref (
base_id int
not null,
EV foreign key (id_person) references person (id_person));
EV For example:
EV I put a row in table PERSON with id_person = 1
EV If I try to put in table FRIENDS id_person = 7, I get...why?
EV Should not give error?
EV And the referential integrity?
I guess your table is not InnoDB
Hi!
Since InnoDB implements foreign keys at a low level, it cannot presently
instruct MySQL to change the table definition in the .frm file and create a
new index.
We can modify the MySQL parser though so that it will treat
FOREIGN KEY (...) REFERENCES ...
like it does an ordinary KEY
oughtness, but I can tell you from frustrating personal experience that
Oracle, like MySQL, does not auto-create indexes on foreign keys. But,
unlike MySQL, Oracle does not require that the foreign key column be indexed.
So there is no syntactical error in Oracle. Your code runs, but your
queries
Pierre,
Tuesday, June 25, 2002, 3:54:28 PM, you wrote:
PB how to remove a foreign key constraint without recreating the innodb table ?
No, it's not possible ...
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http
Hi!
NOT NULL does not prevent the creation of a foreign key constraint. I think
the problem was that Andy did not create an index explicitly on the foreign
key (he created only on the referenced key).
Regards,
Heikki
Innobase Oy
- Original Message -
From: Roger Baklund [EMAIL
how to remove a foreign key constraint without recreating the innodb table ?
thanks,
Pierre
sql,query
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com
... ;)
Ouch, you are correct, although they are the same *type*. However, this
seems like a fairly severe restriction. Obviously a primary key must be
NOT NULL, but there are certainly cases where a column which refers to a
foreign key must be NULL. The docs do say that the foreign key
constraints
,
...does not look the same to me... ;)
Ouch, you are correct, although they are the same *type*. However, this
seems like a fairly severe restriction. Obviously a primary key must be
NOT NULL, but there are certainly cases where a column which refers to a
foreign key must be NULL. The docs do say
it. In fact now I see this in the on-line docs: Both
tables have to be InnoDB type and there must be an index where the
foreign key and the referenced key are listed as the first columns.
InnoDB does not auto-create indexes on foreign keys or referenced keys:
you have to create them explicitly
Description:
In CREATE TABLE, column-spec REFERENCES does nothing, as described
in the documentation.
If FOREIGN KEY (x) REFERENCES othertable(y) is added to the table, as
described in the documentation:
http://www.mysql.com/doc/S/E/SEC446.html
I always get an error like this:
ERROR 1005
* [EMAIL PROTECTED]
[...]
The referred to keys are the same type and are indexed (they are
[...]
CREATE TABLE genres (
genre_idSMALLINT NOT NULL PRIMARY KEY,
[...]
genre_idSMALLINT,
...does not look the same to me... ;)
--
Roger
sql
Hello.
On Fri 2002-06-21 at 10:47:28 -0400, [EMAIL PROTECTED] wrote:
On Thursday 20 June 2002 21:15, Benjamin Pflugmann wrote:
IMHO, the interesting question is: how could the tables get out of
sync, in a way that foreign keys would be able to prevent? I am not
able to see a way in
Friends,
I am designing a MySql DB schema that will use foreign
keys similar to:
create table orders(id int auto_increment primary key,
amount double(7,2) );
create table orderItems(id int, item char(20), price
double(5,2), quantity int, key(id), foreign key id
references orders (id));
I am
(5,2), quantity int, key(id), foreign key id
references orders (id));
I am currently not using a version that supports
foreign keys but hope to be in the future. In the
meantime I'll need to implement the foreign key
constraints through my application. My concern is
that if either
. At the comment of the
table, it used to store the foreign key relations but after the corruption
it writes nonsense characters like #sql2-218-48...
InnoDB free: 40960 kB; (MSISDN) REFER inoxpp/#sql2-218-48(MS
Has anyone else faced this problem before?
Regards
Okan
B.K.R.,
Tuesday, June 18, 2002, 5:52:07 AM, you wrote:
BKRS Can I have more than one foreign key defined in a
BKRS single table using MySQL/Innodb table type?
Yes, it's possible.
BKRS It gives an error in .frm file, if tried to have
BKRS that?
BKRS Any solution?
Check your CREATE TABLE
I am using MySql-3.23.51. Even though this version
doesn't support foreign keys, the foreign key
declarations can be entered without getting an error
message. I would like to write CREATE TABLE
statements that include foreign key declarations that
would be compatible with future releases
I'm using MySQL Max 4.0.1
CREATE TABLE TableTwo
(
Id int NOT NULL auto_increment,
FK_TableOne int NOT NULL REFERENCES TableOne(Id),
PRIMARY KEY (Id)
) TYPE=InnoDB;
-- How can this work without having beforehand created the table TableOne
???
On Wed, 12 Jun 2002, Christophe BRAM wrote:
I'm using MySQL Max 4.0.1
CREATE TABLE TableTwo
(
Id int NOT NULL auto_increment,
FK_TableOne int NOT NULL REFERENCES TableOne(Id),
PRIMARY KEY (Id)
) TYPE=InnoDB;
-- How can this work without
-Message d'origine-
De : Tonu Samuel [mailto:[EMAIL PROTECTED]]
Envoye : mercredi 12 juin 2002 10:51
A : Christophe BRAM
Cc : [EMAIL PROTECTED]
Objet : Re: Foreign key integrity pb ?
On Wed, 12 Jun 2002, Christophe BRAM wrote:
I'm using MySQL Max 4.0.1
CREATE TABLE
Hello list!
I'm having a bit of trouble getting foreign key constraints to work.
I'm running MySQL 2.23.50-Max.
Here's what I got:
mysql SHOW CREATE TABLE conn\G
*** 1. row ***
Table: conn
Create Table: CREATE TABLE `conn` (
`id` int(10
` (`comp_name`),
KEY `conn_idx` (`name_id`) - AND THIS IS THE SECOND ONE
...
At 10:59 2002.06.10. +0300, you wrote:
Hello list!
I'm having a bit of trouble getting foreign key constraints to work.
I'm running MySQL 2.23.50-Max.
Here's what I got:
mysql SHOW CREATE TABLE conn\G
ip_name_tbl
- ADD CONSTRAINT FOREIGN KEY (name_id)
- REFERENCES conn(name_id)
- ON DELETE CASCADE;
ERROR 1005: Can't create table './koneet/#sql-355_4.frm' (errno: 150)
I know error 1005 with an errno 150 means the foreign key would be
incorrectly
formed, but I can't just figure out
) NOT NULL default '',
`name_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`name_id`),
KEY `id` (`id`)
) TYPE=InnoDB
and, again:
mysql ALTER TABLE ip_name_tbl
- ADD CONSTRAINT FOREIGN KEY (name_id)
- REFERENCES conn (name_id)
- ON DELETE CASCADE;
ERROR 1005: Can't create
On Monday 10 Jun 2002 11:44 am, Markus Lervik wrote:
mysql show create table ip_name_tbl\G
*** 1. row ***
Table: ip_name_tbl
Create Table: CREATE TABLE `ip_name_tbl` (
[snip]
`name_id` int(11) NOT NULL default '0',
[snip]
mysql show
What I think, is that your syntax for creating the primary key is slightly
incorrect. I'm not sure if this is also true vor MySQL but I got teached at
school that a foreign key can only point to the primary key of a table.
Perhaps you can try to do the following:
Create Table: CREATE TABLE `conn
Hi All
I am currently using 3.23.49 Max on Win 2K.
I just saw from the docs that this version supports foreign key...So i just
thought of working on it...
I just created two tables parent and child
CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE child(id INT
Hello,
I'm using InnoDB tables, is there a way to know which foreign key constraint
was violated? Oracle gives me the constraint name in the error message, so
that I can seek in the data dictionary. I'm porting an web application
developed for Oracle to MySQL, so I need a solution
I was hoping for some help with this -- I'm not sure if I can use just
one SQL statement to pull this data out, I think I need to use two
separate statements. Can someone clarify for me?
My tables:
+-+ +---+
| people | | projects |
+-+
Hi all!
Question. I try to understand with 4.3 Foreign key constraints
InnoDB Engine in MySQL-Max-3.23.50/MySQL-4.0.1.
I use MySQL Max (InnoDB) 3.23.49 for Win2000
I have created two tables:
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)) TYPE=INNODB;
CREATE
maxim,
Tuesday, May 28, 2002, 4:47:13 PM, you wrote:
m Question. I try to understand with 4.3 Foreign key constraints
m InnoDB Engine in MySQL-Max-3.23.50/MySQL-4.0.1.
m I use MySQL Max (InnoDB) 3.23.49 for Win2000
m I have created two tables:
m CREATE TABLE parent (id INT NOT NULL,
m
Hi all!
Question. I try to understand with 4.3 Foreign key constraints
InnoDB Engine in MySQL-Max-3.23.50/MySQL-4.0.1.
I use MySQL Max (InnoDB) 3.23.49 for Win2000
I have created two tables:
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)) TYPE=INNODB;
CREATE
Hello,
The documentation often mentions that foreign key support in mysql is
not implemented because it slows down the database server. The argument
is that since the applications built on top of mysql have to check for
database integrity constraints (ICs) it is redundant for the database
Lisa,
- Original Message -
From: Lisa Tong [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Tuesday, May 14, 2002 5:29 AM
Subject: foreign key constraint to itself
Hi,
I am just wondering can I create foreign key constraint to itself in mySQL
innodb (the mySQL 3.23.50
Hi,
I am just wondering can I create foreign key constraint to itself in mySQL
innodb (the mySQL 3.23.50 release)?
Let's say we have a table: test_table_01 (id integer, pid integer) type =
innodb.
Can I create a foreign key on pid and reference to test_table_01 (id)?
Thanks,
Lisa
Daniel,
- Original Message -
From: Daniel Rand [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Monday, May 13, 2002 5:24 PM
Subject: InnoDB Foreign Key Constraints
Hi,
Does anyone know if it's possible to set up a foreign key constraint where
one table references
Hi,
I am just wondering can I create foreign key constraint to itself in mySQL
innodb (the mySQL 3.23.50 release)?
Let's say we have a table: test_table_01 (id integer, pid integer) type =
innodb.
Can I create a foreign key on pid and reference to test_table_01 (id)?
Thanks,
Lisa
Hello !
How to use foreign key in mysql.
I am using mysql 3.23.36
Thanx in advance
Regards
Shimak
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com
* shimak
How to use foreign key in mysql.
I am using mysql 3.23.36
Just do it... :)
A foreign key is a field in a table referencing the primary key of another
table. In mysql you don't need to specify which columns are foreign keys,
you just use them in a join, and mysql will do the rest
shimak,
Thursday, May 02, 2002, 11:22:38 AM, you wrote:
s How to use foreign key in mysql.
:)
I think checking MySQL manual will be usefull for you:
http://www.mysql.com/doc/S/E/SEC445.html
http://www.mysql.com/doc/e/x/example-Foreign_keys.html
http://www.mysql.com/doc
At 08:29 29/04/02 -0700, Jeremy Zawodny wrote:
On Mon, Apr 29, 2002 at 01:06:02PM +0100, David Hanney wrote:
I've got a nice fat varchar(255) primary key who's content is
duplicated (as a foreign key) in many other tables. I hope MySQL
optimizes away that duplication internally
On Mon, Apr 29, 2002 at 01:06:02PM +0100, David Hanney wrote:
I've got a nice fat varchar(255) primary key who's content is
duplicated (as a foreign key) in many other tables. I hope MySQL
optimizes away that duplication internally.
Not as much as you're probably hoping for. Consider
Hello,
I create innoDB tables database in mysql3.23.49.
i create foreign key constraints(On UPdate cascade) in
one table. but it seems doesn't work. the system just
refused to update.
I am wondering the innodb in mysql doesn't support the
feature like on update cascade or on delete cascade
Hi!
The brand-new source prerelease 3.23.50b-pre which you can download from
http://www.innodb.com supports ON DELETE CASCADE and ON DELETE SET NULL. But
does not support ON UPDATE CASCADE. Typically a foreign key refers to the
primary key of another table, and it is not that common a primary
Carl,
Monday, April 08, 2002, 3:16:26 AM, you wrote:
CS From the mysql docs, it looks like you can only use foreign keys if your
CS tables are type InnoDB. Is this correct?
Yes, you are right. In MyISAM tables you can use REFERENCE
clause, but it does nothing.
CS Carl
--
For
Hi,
Yes, you are right but be aware with the delete cascade feature, maybe in
the way?.
Regards
- Original Message -
From: Carl Schmidt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 07, 2002 7:16 PM
Subject: FOREIGN KEY Constraints
From the mysql docs, it looks like you
From the mysql docs, it looks like you can only use foreign keys if your
tables are type InnoDB. Is this correct?
Carl
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
Hi,
Should I or shouldn't I explicitly specify the foreign
key in Mysql? If I am not mistaken, Mysql handles
foreign keys automatically at query time and we need
not explicitly specify the foreign key.
But, will the database detect error when I enter
non-existent value for a foreign key?
Do I
Hi.
I am using MySQL 3.23.44-max and InnoDB tables.
I also using foreign key in my tables.
I have problem, I couldn't alter my table and add any foreign keys.
SQL like this: alter table data_entry add FOREIGN KEY (data_task_id) REFERENCES
data_task(identity);
give me any error but key doesn't
Hello,
I am encountering one problem. I am using mysql as the
dabase for my application.
I create a table like takeexam as following:create
table takelabexam( sid varchar(10) not null,
cid varchar(20) not null,
marks integer
foreign
Hello,
I am encountering one problem. I am using mysql as the
dabase for my application.
I create a table like takeexam as following:create
table takelabexam( sid varchar(10) not null,
cid varchar(20) not null,
marks integer
foreign
foreign key (cid) references course on Update
cascade ,
primary key (sid, cid,labsection,year));
cid in takelabexam references cid in table courses.
so if i update the cid in courses table. the records
in table takelabexam which references to courses
should be updated automatically
hello
i creates two table t1 and t2;
CREATE TABLE t1 (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) TYPE=InnoDB;
CREATE TABLE t2 (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
t1id INT UNSIGNED NOT NULL,
PRIMARY KEY (id),
KEY (t1id),
FOREIGN KEY
Hi,
I want to correct myself about Mysql-Max . I installed mysql-max and worked
with java application works perfectly and could create InnoDB tables with Foreign Key
references, but I need to know about is it installed perfectly and supports
transaction or any other settings have
Hi All.
Do MySQL are going to support NULL value for foreign key fields (in case parent are
not null)
I didn't found any mentions about this problem in news or somewhere else.
If you have any kind of info please answer.
Because so hard to use foreign keys without this option.
Sincerely yours
Below I have two queries. They both should do the same thing but the foreign
key syntax is a little different. The first query fails, though some queries
with foreign key clauses work sometimes, and the second one just works.
Am I right in thinking the syntax for both these queries mean the same
fine. Reference different tables
: and it's fine.
:
: mysql-3.23.47 InnoDB tables under Sparc Solaris 8
:
:
:
: mysql create table test_base ( fld int not null );
: Query OK, 0 rows affected (0.07 sec)
:
: mysql create table test_fk ( fld1 int not null, fld2 int not null, foreign key
:(fld1
not null,
foreign key (fld1) references test_base(fld), foreign key (fld2 references
test_base(fld) );
: ERROR 1064: You have an error in your SQL syntax near 'references
test_base(fld) )' at line 1
: mysql create table test_fk ( fld1 int not null, fld2 int not null,
foreign key (fld1) references
(fld) );
Query OK, 0 rows affected (0.00 sec)
mysql create table test_fkey ( fld1 int not null, fld2 int not null, foreign key
(fld1) references test_bk(fld), foreign key (fld2) references test_bk(fld));
ERROR 1005: Can't create table './test/test_fkey.frm' (errno: 150)
mysql create table test_fkey
Name = Somebody
Lastname; The values haven't been updated. They remain 0
and 0.
What gives? Is this a foreign key problem?
TIA.
PS. Oh yeah, I'm using mysql 3.22 on debian 2.2.
--
David S. Jackson[EMAIL PROTECTED
501 - 600 of 649 matches
Mail list logo