Re: Foreign Keys Problem

2009-11-20 Thread Victor Subervi
On Thu, Nov 19, 2009 at 9:34 PM, Ye Yuan yuan4...@gmail.com wrote: Hi Victor, It looks to me the foreign key syntax is wrong. Can you create the Relationship table on your database by using below ddl? create table if not exists Relationship (ID integer auto_increment primary key, Parent

Re: foreign keys: Cannot create InnoDB table

2009-08-20 Thread wabiko.takuma
Hi, Martijn, Gavin. SHOW INNODB STATUS gave me helpful messages like following: LATEST FOREIGN KEY ERROR 090821 12:53:18 Error in foreign key constraint of table test_fk/tbl1: FOREIGN KEY (`col1` , `col2` , `col3` ) REFERENCES

Re: foreign keys: Cannot create InnoDB table

2009-08-14 Thread Martijn Tonies
Hi, I can't create InnoDB table with foreign key constraints using more than 3 colmuns. When I create table `test_fk`.`tbl1`, it gives me: Can't create table 'test_fk.tbl1' (errno: 150) why? CREATE TABLE syntax looks perfectly right to me. Any suggestions are welcome. Thank you, wabi

RE: foreign keys: Cannot create InnoDB table

2009-08-14 Thread Gavin Towey
Run: SHOW ENGINE INNODB STATUS \G And look for the LATEST FOREIGN KEY ERROR section. It'll explain the reason for the (errno: 150) message. Regards, Gavin Towey -Original Message- From: wabiko.takuma [mailto:wab...@sysrdc.ns-sol.co.jp] Sent: Friday, August 14, 2009 3:35 AM To:

Re: Foreign Keys

2008-10-08 Thread Jim Lyons
Indexes speed up joins. Foreign keys should be indexes themselves, so they can also speed up joins. If the FK is not an index, it won't help. So, index your FKs On Wed, Oct 8, 2008 at 10:43 AM, Ben A.H. [EMAIL PROTECTED] wrote: Does using foreign keys simply enforce referential integrity OR

Re: Foreign Keys

2008-10-08 Thread Arthur Fuller
So you are talking about parent-child relationships in a single table, or in the technical jargon reflexive relationships. See www.artfulsoftware.com for detailed examples of how this is done, but here is the thumbnail sketch: The table has to have a ParentID column (call it what you want) that

Re: Foreign Keys

2008-10-08 Thread Ben A.H.
I know that this is the standard means of dealing with a many to many relationship, I'm just not sure it fits here. USER: emailID (PK) userName Password Address Etc FRIEND: emailID (PK) USER_FRIEND user_emailID (PK)

RE: Foreign Keys

2008-10-08 Thread Ben A. Hilleli
Programmer / Analyst _ From: Arthur Fuller [mailto:[EMAIL PROTECTED] Sent: October 8, 2008 2:55 PM To: Ben A.H. Cc: mysql@lists.mysql.com Subject: Re: Foreign Keys So you are talking about parent-child relationships in a single table, or in the technical jargon reflexive

Re: Foreign Keys

2008-10-08 Thread Peter Brawley
:* Arthur Fuller [mailto:[EMAIL PROTECTED] *Sent:* October 8, 2008 2:55 PM *To:* Ben A.H. *Cc:* mysql@lists.mysql.com *Subject:* Re: Foreign Keys So you are talking about parent-child relationships in a single table, or in the technical jargon reflexive relationships. See www.artfulsoftware.com http

Re: Foreign Keys

2008-10-08 Thread Perrin Harkins
On Wed, Oct 8, 2008 at 11:56 AM, Jim Lyons [EMAIL PROTECTED] wrote: Indexes speed up joins. Foreign keys should be indexes themselves, so they can also speed up joins. If the FK is not an index, it won't help. So, index your FKs If you add a FOREIGN KEY constraint in MySQL 5+ it adds an

Re: Foreign Keys

2008-08-25 Thread Joerg Bruehe
Hi Steffan, all ! Steffan A. Cline wrote: [[...]] I am hoping that by using FK based relationships I can just do one massive insert into the parent table and include all related columns and somehow magically all field and relational keys fall into place. AFAIK, this isn't possible.

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
Joerg- Your comments below are excellent and my comments are just building off what you have so clearly stated. I think Stefan's best bet would be a stored procedure. Pass all the data, insert the parent record (or make sure the parent record exists ... perhaps it already is present) and then do

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
I forgot to mention that the only benefit of a stored procedure would be minimizing code in your application. you'd have a single call to the stored procedure... though some people may prefer having the back-to-back insert statements in their code. On Mon, Aug 25, 2008 at 11:28 AM, Tom Nugent

Re: Foreign keys on non-unique columns (problem)

2007-11-04 Thread Martijn Tonies
Hi Yves, I have a problem with my foreign keys. I have the following two tables: CREATE TABLE keylist ( KeylistId INTEGER NOT NULL, UserId INTEGER NOT NULL, PRIMARY KEY (KeylistId, UserId)); CREATE TABLE user ( UserId INTEGER NOT NULL PRIMARY KEY, AdditionalKeylist

Re: Foreign keys on non-unique columns (problem)

2007-11-04 Thread Yves Goergen
On 04.11.2007 21:10 CE(S)T, Martijn Tonies wrote: Now I have added this foreign key constraint: ALTER TABLE user ADD FOREIGN KEY (AdditionalKeylist) REFERENCES keylist (KeylistId) ON DELETE SET NULL; This cannot work. The column in KEYLIST to which you are pointing should have a unique

Re: Foreign keys on non-unique columns (problem)

2007-11-03 Thread Yves Goergen
On 03.11.2007 22:52 CE(S)T, Yves Goergen wrote: Is my design bad? I should explain why I do it this way at all. There's some other tables in my system that need to keep a list of keys (i.e. user IDs) for several actions. A message (one of the tables) has one keylist for read access, one for

Re: Foreign keys

2006-03-24 Thread Olusola Fadero
I had that problem as well and a quick search revealed this: A) Whole databases are not handled by InnoDB. The individual tables are. Check the results of SHOW CREATE TABLE table_name_here for each table you are linking from and linking to. You should see ENGINE = InnoDB after the last ) but

בעניין: RE: FOREIGN KEYS

2006-03-11 Thread Nanu Kalmanovitz
Thanks! Nanu Ing. Edwin Cruz [EMAIL PROTECTED] 10/03/2006 22:06:27 Ive found this on internet: If you re-create a table which was dropped, it has to have a definition which conforms to the foreign key constraints referencing it. It must have the right column names and types, and it must have

Re: FOREIGN KEYS

2006-03-10 Thread SGreen
Nanu Kalmanovitz [EMAIL PROTECTED] wrote on 03/10/2006 02:35:08 PM: Hi! Server system SBS (Novell Small Business suite) 6.5 sp 1 with MySQL ver. 4.0.15a, PHP 4.2.3, all of them on same machine. I just finished create a new DB called TIULIM (InnoDB) with 3 tables (Sites, Tracks Pathes).

RE: FOREIGN KEYS

2006-03-10 Thread Ing. Edwin Cruz
I´ve found this on internet: If you re-create a table which was dropped, it has to have a definition which conforms to the foreign key constraints referencing it. It must have the right column names and types, and it must have indexes on the referenced keys, as stated above. If these are not

Re: Foreign Keys

2005-09-29 Thread SGreen
Nick Hird [EMAIL PROTECTED] wrote on 09/29/2005 05:03:53 PM: Is there a way to have foreign keys and force referential integrity? I have a main table and a lookup table, i want to be able to require that the main table is using values from the lookup table. I am just not sure how in MySQL.

Re: foreign keys in MyISAM?

2005-09-24 Thread Gleb Paharenko
Hello. I don't know the date you're asking about. However, you can implement the FKs' features using stored procedures in MySQL 5.0. For a small example have a look at the nice article about stored procedures: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html

Re: foreign keys in MyISAM?

2005-09-24 Thread Martijn Tonies
I don't know the date you're asking about. However, you can implement the FKs' features using stored procedures in MySQL 5.0. For a small example have a look at the nice article about stored procedures: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html Hmmm... given

Re: foreign keys in MyISAM?

2005-09-23 Thread Kevin Burton
On Sep 23, 2005, at 12:27 PM, Jacek Becla wrote: Hi, The documentation says At a later stage, foreign key constraints will be implemented for MyISAM tables as well. Does anybody know what is the timescale? I'm not sure there is a timescale.. I think it might be pretty open ended. You

Re: Foreign keys across databases?

2005-09-19 Thread Martijn Tonies
Hello Jake, I would like to use separate databases to group certain related tables to keep things clean, but I would also like to use foreign keys to enforce referential integrity between tables in different databases. I don't think this is possible. Am I right? And if so, am I reduced to

Re: Foreign keys - No action - Errors

2005-05-24 Thread Frank Schröder
My understanding is that RESTRICT and NO ACTION share the same behavior. http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html * |NO ACTION|: In |ANSI SQL-92| standard, |NO ACTION| means /no action/ in the sense that an attempt to delete or update a primary

Re: Foreign keys

2004-07-22 Thread Martijn Tonies
Hi, I have a table that with a TEXT filed as a primary key. I can't make a foreign key of this field on another table, why does this happens? Ex: Product --- | ref - text, PK | name - text | ProductsList | ID int, PK | profref - foreign key of the table product | I'm

Re: foreign keys......

2004-07-08 Thread Michael Stassen
Tom Roos wrote: hi how does 1 know if a foreign key is defined? describe tablename and show index from tablename dont sufice tks SHOW CREATE TABLE tablename; or SHOW TABLE STATUS LIKE 'tablename'; Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: foreign keys......

2004-07-08 Thread Peter Brawley
Look for a substring beginning with 'FOREIGN KEY' in the result of 'SHOW CREATE TABLE tblname'. PB - Original Message - From: Tom Roos To: [EMAIL PROTECTED] Sent: Thursday, July 08, 2004 10:05 AM Subject: foreign keys.. hi how does 1 know if a foreign key is

Re: foreign keys help

2004-04-17 Thread Victoria Reznichenko
saiph [EMAIL PROTECTED] wrote: alea mysql -V mysql Ver 12.22 Distrib 4.0.17, for pc-linux-gnu (i386) but mysql SHOW VARIABLES LIKE have_innodb; +---+---+ | Variable_name | Value | +---+---+ | have_innodb | NO| +---+---+ 1 row

Re: foreign keys help

2004-04-16 Thread saiph
- snip - Because your tables are not InnoDB. Check if InnoDB is enabled: SHOW VARIABLES LIKE have_innodb; - snip - no, InnoDB is not enabled. how can i enable it? the referece manual show a my.cnf configuration for a machine with at least 2gb of ram and 60 of hard disk. how can i

Re: foreign keys help

2004-04-16 Thread Victoria Reznichenko
saiph [EMAIL PROTECTED] wrote: - snip - Because your tables are not InnoDB. Check if InnoDB is enabled: SHOW VARIABLES LIKE have_innodb; - snip - no, InnoDB is not enabled. how can i enable it? What version of MySQL do you use? 3.23.xx or 4.0.x? If you use 3.23 you should install

Re: Foreign Keys

2004-04-16 Thread Martijn Tonies
Hi, I am new to mysql. I am trying to create tables with foreign key constraints. but the constraintsdoesnt seem to be showing any effect on the table. I am able to add any info in the foreign key table witout the same info in the main table. what is the problem?? 1) are you running the

RE: Foreign Keys

2004-04-16 Thread Victor Pendleton
Can you please post your DDL? -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 4/16/04 10:22 AM Subject: Foreign Keys hi, I am new to mysql. I am trying to create tables with foreign key constraints. but the constraintsdoesnt seem to be showing any effect on the

Re: foreign keys help

2004-04-16 Thread saiph
alea mysql -V mysql Ver 12.22 Distrib 4.0.17, for pc-linux-gnu (i386) but mysql SHOW VARIABLES LIKE have_innodb; +---+---+ | Variable_name | Value | +---+---+ | have_innodb | NO| +---+---+ 1 row in set (0.09 sec) why? the gentoo

Re: foreign keys help

2004-04-15 Thread Victoria Reznichenko
saiph [EMAIL PROTECTED] wrote: i'm studing foreign keys but my sql code does not react as would imagine when i insert inconsistent data. i.e. create database urls; use urls; create table caths ( name varchar(7) primary key ) type = innodb; create table urls ( name

Re: foreign keys help

2004-04-14 Thread Ligaya Turmelle
Don't foreign keys need to be explicitly indexed? Respectfully, Ligaya Turmelle saiph [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi list, i'm studing foreign keys but my sql code does not react as would imagine when i insert inconsistent data. i.e. create database urls;

Re: Foreign Keys in CREATE TABLEs produced by mysqldump

2003-12-30 Thread Heikki Tuuri
Michael, - Alkuperäinen viesti - Lähettäjä: [EMAIL PROTECTED] Vastaanottaja: Heikki Tuuri [EMAIL PROTECTED] Kopio: [EMAIL PROTECTED] Lähetetty: Monday, December 29, 2003 11:53 PM Aihe: Re: Foreign Keys in CREATE TABLEs produced by mysqldump Heikki Tuuri [EMAIL PROTECTED] wrote on 12

Re: Foreign Keys in CREATE TABLEs produced by mysqldump

2003-12-29 Thread michael_muir
Heikki Tuuri [EMAIL PROTECTED] wrote on 12/24/2003 01:53:07 PM: Michael, this is the question where the valid answer is: upgrade! In which version was this corrected? I'm hesitant to upgrade to the latest and greatest without it being banged on by the masses first.. I have half a dozen or

Re: foreign keys plz?

2003-12-27 Thread Martijn Tonies
Hi, Hi there. I heave heared that mysql doesnot support foreign keys? It does, but only with the InnoDB table type. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL MS SQL Server. Upscene Productions http://www.upscene.com -- MySQL General

Re: foreign keys plz?

2003-12-27 Thread Alaios
with myIsam? Does not check about integrity? Mysql 3.2? What u will use for your application Innodb or MyISAM? --- Martijn Tonies [EMAIL PROTECTED] wrote: Hi, Hi there. I heave heared that mysql doesnot support foreign keys? It does, but only with the InnoDB table type. With

Re: foreign keys plz?

2003-12-27 Thread Roger Baklund
* Alaios with myIsam? Does not check about integrity? That is correct, the myisam table handler does not support foreign key constraints. It does of course support foreign keys, but not foreign key constraints, consequently the foreign key itegrity is not checked for myisam tables. Mysql 3.2?

Re: Foreign Keys in CREATE TABLEs produced by mysqldump

2003-12-24 Thread Heikki Tuuri
Michael, - Original Message - From: [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, December 24, 2003 1:45 AM Subject: Foreign Keys in CREATE TABLEs produced by mysqldump --=_alternative 008277CD88256E05_= Content-Type: text/plain; charset=US-ASCII First let

Re: foreign keys.

2003-12-17 Thread Victoria Reznichenko
Mofeed Shahin [EMAIL PROTECTED] wrote: mysql CREATE TABLE foo ( - ID INT PRIMARY KEY, - note VARCHAR(50), - First_Name VARCHAR(50), - Last_Name VARCHAR(50), - FOO_ID INT, - INDEX(FOO_ID), -

Re: foreign keys.

2003-12-17 Thread Heikki Tuuri
backup tool for InnoDB which also backs up MyISAM tables Order MySQL technical support from https://order.mysql.com/ - Original Message - From: Mofeed Shahin [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, December 17, 2003 1:19 AM Subject: Re: foreign keys

Re: foreign keys.

2003-12-17 Thread Mofeed Shahin
On Wed, 17 Dec 2003 07:55 pm, Victoria Reznichenko wrote: Mofeed Shahin [EMAIL PROTECTED] wrote: mysql CREATE TABLE foo ( - ID INT PRIMARY KEY, - note VARCHAR(50), - First_Name VARCHAR(50), - Last_Name VARCHAR(50), - FOO_ID

Re: foreign keys.

2003-12-17 Thread Mofeed Shahin
[EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, December 17, 2003 1:19 AM Subject: Re: foreign keys. mysql CREATE TABLE foo ( - ID INT PRIMARY KEY, - note VARCHAR(50), - First_Name VARCHAR(50), - Last_Name

Re: foreign keys.

2003-12-17 Thread Heikki Tuuri
Mofeed, - Original Message - From: Mofeed Shahin [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:20 AM Subject: Re: foreign keys. Hmmm, Thanks for that. But I'm not quite sure what it means. Mof

Re: foreign keys.

2003-12-17 Thread Mofeed Shahin
On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote: Mofeed, - Original Message - From: Mofeed Shahin [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:20 AM Subject: Re: foreign keys. Hmmm, Thanks for that. But I'm

Re: foreign keys.

2003-12-17 Thread Heikki Tuuri
Mofeed, - Original Message - From: Mofeed Shahin [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:47 AM Subject: Re: foreign keys. On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote: Mofeed, - Original Message

Re: foreign keys.

2003-12-17 Thread Mofeed Shahin
, 2003 12:47 AM Subject: Re: foreign keys. On Thu, 18 Dec 2003 09:05 am, Heikki Tuuri wrote: Mofeed, - Original Message - From: Mofeed Shahin [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:20 AM Subject: Re

Re: foreign keys.

2003-12-16 Thread Victoria Reznichenko
Mofeed Shahin [EMAIL PROTECTED] wrote: Still doesn't work But thanks for trying. Worked fine for me: mysql CREATE TABLE Blah ( - ID INT PRIMARY KEY, - Fname VARCHAR (50), - Lname VARCHAR (50), - UNIQUE (Fname, Lname) - ) TYPE=INNODB; Query

Re: foreign keys.

2003-12-16 Thread Mofeed Shahin
mysql CREATE TABLE foo ( - ID INT PRIMARY KEY, - note VARCHAR(50), - First_Name VARCHAR(50), - Last_Name VARCHAR(50), - FOO_ID INT, - INDEX(FOO_ID), - INDEX(First_Name, Last_Name), -

Re: foreign keys.

2003-12-15 Thread Victoria Reznichenko
Mofeed Shahin [EMAIL PROTECTED] wrote: On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote: At 11:09 +1030 12/15/03, Mofeed Shahin wrote: I'm trying to create a bunch of tables in MySQL. I'm having problems creating the following table : CREATE TABLE foo( ID INT PRIMARY KEY, note

RE: foreign keys.

2003-12-15 Thread Bob Loeffler
PROTECTED] Subject: Re: foreign keys. On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote: At 11:09 +1030 12/15/03, Mofeed Shahin wrote: I'm trying to create a bunch of tables in MySQL. I'm having problems creating the following table : CREATE TABLE foo( ID INT PRIMARY KEY, note VARCHAR

Re: foreign keys.

2003-12-15 Thread Mofeed Shahin
On Mon, 15 Dec 2003 09:22 pm, Victoria Reznichenko wrote: Mofeed Shahin [EMAIL PROTECTED] wrote: On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote: At 11:09 +1030 12/15/03, Mofeed Shahin wrote: I'm trying to create a bunch of tables in MySQL. I'm having problems creating the following

Re: foreign keys.

2003-12-15 Thread Aftab Jahan Subedar
If you have foreign key then add a key for each, so the CREATE TABLE foo ( ID INT PRIMARY KEY, note VARCHAR(50), Fname VARCHAR(50), Lname VARCHAR(50), FOO_ID INT, INDEX(FOO_ID), KEY(Fname,Lname), #here this one--if it does not work,its not me FOREIGN KEY (FOO_ID)

Re: foreign keys.

2003-12-15 Thread Chris Nolan
Hi, Have you considered just normalising the schema a bit more? It looks like you're attempting to duplicate data within the table (which you don't strictly need) and duplicating Fname and Lname between Blah and foo. Why not just have an AUTO_INCREMENT column (or some other unique row

Re: foreign keys.

2003-12-15 Thread Mofeed Shahin
Still doesn't work But thanks for trying. Mof. On Tue, 16 Dec 2003 11:40 am, Aftab Jahan Subedar wrote: If you have foreign key then add a key for each, so the CREATE TABLE foo ( ID INT PRIMARY KEY, note VARCHAR(50), Fname VARCHAR(50), Lname VARCHAR(50),

Re: foreign keys.

2003-12-15 Thread Mofeed Shahin
Its not my data. I'm simply writting a program that reads in the meta data, and does stuff with it client side. I just need to be able to handle all sorts of stuff, and I wanted to test it on MySQL (amongst others). Mof. On Tue, 16 Dec 2003 11:49 am, Chris Nolan wrote: Hi, Have you

Re: foreign keys.

2003-12-14 Thread Paul DuBois
At 11:09 +1030 12/15/03, Mofeed Shahin wrote: I'm trying to create a bunch of tables in MySQL. I'm having problems creating the following table : CREATE TABLE foo( ID INT PRIMARY KEY, note VARCHAR(50), FOO_ID INT, FOREIGN KEY (FOO_ID) REFERENCES foo(ID) )

Re: foreign keys.

2003-12-14 Thread Mofeed Shahin
On Mon, 15 Dec 2003 12:42 pm, Paul DuBois wrote: At 11:09 +1030 12/15/03, Mofeed Shahin wrote: I'm trying to create a bunch of tables in MySQL. I'm having problems creating the following table : CREATE TABLE foo( ID INT PRIMARY KEY, note VARCHAR(50), FOO_ID INT,

Re: Foreign Keys

2003-08-14 Thread Nils Valentin
Hi there, here a simple sample (basicall taken from the documents) with 3 tables. 2 points to watch out for: 1) first declare the primary keys here (p1.id and p2.id) 2) index the foreign key column here (child.id1 and child.id2) mysql CREATE TABLE p1(id INT PRIMARY

RE: Foreign Keys

2003-07-16 Thread Rudy Metzger
InnoDB is using a totally different concept than MyISAM. Where in MyISAM all the data is in one file, InnoDB uses the principle of Tablespaces (like ORACLE). This puts the whole tables (and metadata) into one HUGE file (in theory. In practice this file can be split and extends can be defined of

Re: Foreign keys and being FIRST index

2003-03-06 Thread William R. Mussatto
http://www.mysql.com/doc/en/SEC457.html states that there must be an index where the foreign key and the referenced key are listed as the FIRST columns. Will this restriction be lifted soon? It is incredibly frustrating. I don't see why they have to be indexes, and more importantly, I don't

RE: Foreign keys and being FIRST index

2003-03-06 Thread Keith C. Ivey
On 5 Mar 2003, at 19:39, Daevid Vincent wrote: Right, but sometimes it isn't, or you already used up that 'first' spot for a different foreign key reference in another table. I think you're misunderstanding something. In the subject line you talk about the first index, and talking about

Re: Foreign keys and being FIRST index

2003-03-05 Thread Dan Nelson
In the last episode (Mar 05), Daevid Vincent said: http://www.mysql.com/doc/en/SEC457.html states that there must be an index where the foreign key and the referenced key are listed as the FIRST columns. Will this restriction be lifted soon? It is incredibly frustrating. I don't see why they

RE: Foreign keys and being FIRST index

2003-03-05 Thread Daevid Vincent
In the last episode (Mar 05), Daevid Vincent said: http://www.mysql.com/doc/en/SEC457.html states that there must be an index where the foreign key and the referenced key are listed as the FIRST columns. Will this restriction be lifted soon? It is incredibly frustrating. I don't see why

Re: Foreign keys and being FIRST index

2003-03-05 Thread Dan Nelson
In the last episode (Mar 05), Daevid Vincent said: I'm not sure that sentence means what you think it does. What they're saying is you need to index both fields, and if you decide to make that index a compound one with multiple keyparts, the foreign/referenced field must be the first.

Re: foreign keys across databases?

2003-02-23 Thread Heo, Jungsu
You can do this. E.g.: FOREIGN KEY (parent_id) REFERENCES databasename.parent(id) and I'm already using this kind of foreign key. Try yourself ! - Original Message - From: Tor R. Skoglund (NextG) [EMAIL PROTECTED] To: mysql users [EMAIL PROTECTED] Sent: Monday, February 24, 2003 4:59

RE: Foreign keys

2003-01-14 Thread Simon Green
Use table type =Innodb for foreing keys and transacionts...etc and type =myisam for speed Simon -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] Sent: 14 January 2003 10:20 To: MySQL Subject: Foreign keys HI all, I've read the following text in a book: ANSI SQL

Re: Foreign keys

2003-01-14 Thread Zak Greant
On Tue, Jan 14, 2003 at 12:20:06PM +0200, Octavian Rasnita wrote: I've read the following text in a book: ANSI SQL supports a special kind of key called a foreign key. Foreign keys help protect database integrity by enabling the database to manage things such as the deletion of rows with

Re: Foreign keys

2003-01-14 Thread Chris Boget
Use table type =Innodb for foreing keys and transacionts...etc and type =myisam for speed Yes, but do the foreign keys in InnoDB honor the constraints? I think that was the original question. What's the poing of using foreign keys if it's not going to maintain the integrity of your data. That

RE: Foreign keys

2003-01-14 Thread Adolfo Bello
Does MySQL allow using foreign keys or not? It does. Try it by yourself with version 4.0.8 +. Adolfo - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the

RE: Foreign Keys and InnoDb in MySQL

2002-11-15 Thread J. Ceferino Ortega
Hello, In Case 1, you need to change: index i_Tb (customerId, carId) = index i_Tb (carId, customerId) or add index i_carId (carId) In Case 2, you need : foreign key (customerId) references customerTb (customerId) = foreign key (customerId) references customerTb (customerId) on

re: Foreign Keys and InnoDb in MySQL

2002-11-15 Thread Egor Egorov
Bruce, Friday, November 15, 2002, 5:35:21 AM, you wrote: BL I have a problem about foreign key in using MySQL.com manual. According to BL the example in MySQL.com manual, one foreign key is ok. However, I have 3 BL tables (ie. 2 for parent tables and 1 for child table). When I use 2 or more BL

re: Foreign keys in InnoDB tables

2002-10-22 Thread Victoria Reznichenko
Christos, Monday, October 21, 2002, 5:46:07 AM, you wrote: CS Hello I am a brand new user of MySql, and have some questions about CS using InnoDB tables. CS I noticed in the manual that you can only specify CS - ON DELETE SET NULL CS Or CS - ON DELETE CASCADE CS What is the default

Re: foreign keys

2002-09-04 Thread Victoria Reznichenko
Ilyas, Wednesday, September 04, 2002, 2:27:27 PM, you wrote: IK Is it in Mysql 4 possible to use foreign keys? Foreign key constarints are supported in InnoDB tables (3.23 and 4.0) IK If yes, how can I create two tables with foreign keys and use them? Take a look at:

RE: Foreign keys vont delete on cascade

2002-08-09 Thread Alexandre Zglav
- De : Heikki Tuuri [mailto:[EMAIL PROTECTED]] Envoyé : jeudi, 8. août 2002 08:17 À : [EMAIL PROTECTED] Objet : Re: Foreign keys vont delete on cascade Alexandre, ON DELETE CASCADE only works starting from 3.23.50 and 4.0.2. The version numbers are misleading because for the InnoDB subsystem

RE: Foreign keys vont delete on cascade

2002-08-09 Thread Alexandre Zglav
. août 2002 19:53 À : Heikki Tuuri; [EMAIL PROTECTED] Objet : RE: Foreign keys vont delete on cascade OK thanks a lot for your help ! :) I just downloaded the latest version ( 4.0.2) and installed it . I hoped I could keep the settings of my ini file ( my.ini) but I got the following error when

Re: Foreign keys in MySQL

2002-07-10 Thread Roger Baklund
* Hanxue Lee In the MySQL documentation, it is stated that foreign keys in SQL are not used to join tables, but are used mostly for checking referential integrity (foreign key constraints). This could have been formulated in a better way, IMHO. I would even say the statement is wrong. In

Re: Foreign keys in query optimization

2002-06-10 Thread harm de laat
Kiss Dániel wrote: I studied the MySQL and InnoDB manual, but I did not find anything about the internal usage of foreign keys. MySQL does not support foreign keys at the moment. This will be implemented in version 4.1. For more info see:

Re: Foreign keys in query optimization

2002-06-10 Thread cal
If you create in index on your FK then it will be used to optimize the query. =C= * * Cal Evans * Techno-Mage * http://www.calevans.com * - Original Message - From: Kiss Dániel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 10, 2002 9:19 AM Subject: Foreign keys in query

RE: Foreign keys in query optimization

2002-06-10 Thread Weaver, Walt
: [EMAIL PROTECTED] Subject: Re: Foreign keys in query optimization Kiss Dániel wrote: I studied the MySQL and InnoDB manual, but I did not find anything about the internal usage of foreign keys. MySQL does not support foreign keys at the moment. This will be implemented in version 4.1

Re: Foreign keys in query optimization

2002-06-10 Thread Victoria Reznichenko
Kiss, Monday, June 10, 2002, 5:19:17 PM, you wrote: KD I studied the MySQL and InnoDB manual, but I did not find anything about KD the internal usage of foreign keys. KD I mean that I would like to know if foreign keys are used for query KD optimizations or functions like that. KD Because I

Re: Re: Foreign Keys and NULL

2002-05-30 Thread Egor Egorov
Chris, Thursday, May 30, 2002, 1:58:54 AM, you wrote: CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id)

Re: Foreign Keys and NULL

2002-05-29 Thread Chris Knipe
CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE CASCADE) TYPE=INNODB; OI!!! I'm going to

Re: Foreign Keys and NULL

2002-05-29 Thread Gabriel
snip tables OI!!! I'm going to sound like a complete ass now (I know) But since when does MySQL support FOREIGN keys?? *gasp* MAN this is going to make my life S much easier *curses at phpMyAdmin for not having the option* Do remember that this is only valid for mysql

Re: Foreign Keys with MySQL 3.23.49 and 3.23.50

2002-05-28 Thread René Moonen
Hi Nothing is wrong! The behaviour of your example is correct, because MySQL does not support the concept of foreign keys. See section 1.4.4.5 of the MySQL manual. In other words data integrity between two tables is not ensured by MySQL. Your application code must solve this. Regards Rene

Re: Foreign Keys with MySQL 3.23.49 and 3.23.50

2002-05-28 Thread Christopher Book
This example is in InnoDB though, which should support foreign key constraints. Chris Book In other words data integrity between two tables is not ensured by MySQL. Your application code must solve this. - Before posting,

Re: Foreign keys

2002-04-18 Thread Heikki Tuuri
Hi! use mysqlSHOW TABLE STATUS FROM yourdatabasename LIKE 'yourtablename'; Best regards, Heikki Tuuri Innobase Oy --- InnoDB - transactions, row level locking, and foreign key support for MySQL See http://www.innodb.com, download MySQL-Max from http://www.mysql.com - Original Message

Re: Foreign keys

2002-04-18 Thread Victoria Reznichenko
Marius, Thursday, April 18, 2002, 11:43:38 AM, you wrote: MR I have a problem: How can I find the FOREIGN KEY definitions for a table? MR I'm using MySQL 4.0.1 MAX, and I define the table as a InnoDB-table. SHOW TABLE STATUS statement shows you foreign key constraints for a table, look at:

Re: foreign keys

2002-04-08 Thread Victoria Reznichenko
root, Monday, April 08, 2002, 12:24:42 PM, you wrote: r i tried to use the foreign key feature in mysql 4.0.1 using innodb tables . r then i have tried the delete cascade feature but it didn't work . I don't r know why ? have you any suggestions ? . InnoDB does not yet support ON DELETE

Re: Foreign keys in mysqldump?

2002-03-13 Thread Heikki Tuuri
] Newsgroups: mailing.database.mysql Date: Tuesday, March 12, 2002 7:18 PM Subject: Re: Foreign keys in mysqldump? InnoDB Hot Backup-0.33 beta is now available for Windows NT/2000/XP and Linux. Any plans for Solaris by the May 2002 release date? From: Heikki Tuuri [EMAIL PROTECTED] The beta testing

Re: Foreign keys in mysqldump?

2002-03-12 Thread Heikki Tuuri
Bob, I have now improved foreign key support so that version 3.23.50 does 1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this should also show them in mysqldumps; 2. preserve FOREIGN KEY definitions in ALTER TABLE and CREATE INDEX; 3. allow backquotes around column and

Re: foreign keys for relation ships

2002-03-12 Thread Heikki Tuuri
Hi! The message I sent 5 minutes ago answers also this :). I have now improved foreign key support so that version 3.23.50 does 1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this should also show them in mysqldumps; 2. preserve FOREIGN KEY definitions in ALTER TABLE and

RE: Foreign keys in mysqldump?

2002-03-12 Thread Bob McLaughlin
in production work? Thanks much, -Bob -Original Message- From: Heikki Tuuri [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 4:50 AM To: Bob McLaughlin; MySQL Mailing List Subject: Re: Foreign keys in mysqldump? Bob, I have now improved foreign key support so that version

Re: Foreign keys in mysqldump?

2002-03-12 Thread Heikki Tuuri
: Tuesday, March 12, 2002 4:00 PM Subject: RE: Foreign keys in mysqldump? Heikki, You are the man! I am glad you are addressing these issues in 3.23.50. They will make foreign key support in MySQL much more robust (in my opinion, anyway..) Is the .50 release available yet? If not, do you have

Re: Foreign keys in mysqldump?

2002-03-12 Thread Philip Molter
On Tue, Mar 12, 2002 at 11:50:12AM +0200, Heikki Tuuri wrote: : Bob, : : I have now improved foreign key support so that version 3.23.50 does : : 1. show the FOREIGN KEY definitions when you call SHOW CREATE TABLE; this : should also show them in mysqldumps; : 2. preserve FOREIGN KEY

Re: Foreign keys in mysqldump?

2002-03-12 Thread Heikki Tuuri
Philip, -Original Message- From: Philip Molter [EMAIL PROTECTED] To: Heikki Tuuri [EMAIL PROTECTED] Cc: Bob McLaughlin [EMAIL PROTECTED]; MySQL Mailing List [EMAIL PROTECTED] Date: Tuesday, March 12, 2002 4:21 PM Subject: Re: Foreign keys in mysqldump? On Tue, Mar 12, 2002 at 11:50

  1   2   >