Re: Foreign Keys Problem

2009-11-20 Thread Victor Subervi
On Thu, Nov 19, 2009 at 9:34 PM, Ye Yuan 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 integer not

Foreign Keys Problem

2009-11-19 Thread Victor Subervi
Hi; I don't claim to be an expert in MySQL. The following code was largely supplied to me by someone who was. I don't really understand foreign keys. He wrote this off the top of his head, and it's throwing an error. Here's the python code: def catTree(): user, pass

Re: foreign keys: Cannot create InnoDB table

2009-08-20 Thread wabiko.takuma
ATUS \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: Fr

RE: foreign keys: Cannot create InnoDB table

2009-08-14 Thread Gavin Towey
35 AM To: mysql@lists.mysql.com Subject: foreign keys: Cannot create InnoDB table Hi, All, 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: 1

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 --

foreign keys: Cannot create InnoDB table

2009-08-14 Thread wabiko.takuma
Hi, All, 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

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

Re: Foreign Keys

2008-10-08 Thread Peter Brawley
h!/ 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

RE: Foreign Keys

2008-10-08 Thread Ben A. Hilleli
mentioned, thank-you so much! 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 ta

Re: Foreign Keys

2008-10-08 Thread Arthur Fuller
; > USER: > > emailID > > userName > > |1 > > |many > > FRIEND: > > emailID > > |many > > |1 > > USER: > > emailID > > username > > > > (i.e. it's two records in the same USER table)

Re: Foreign Keys

2008-10-08 Thread Ben A.H.
(i.e. it's two records in the same USER table) How are relationships between records in the same table usually dealt with in terms of design? Implementation? ThanX, Ben ""Jim Lyons"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Indexes

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 referen

Foreign Keys

2008-10-08 Thread Ben A.H.
Does using foreign keys simply enforce referential integrity OR can it also speed up JOIN queries? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
OTECTED]> wrote: > >> 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 col

Re: Foreign Keys

2008-08-25 Thread Tom Nugent
gt; 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. > > Foreign

Re: Foreign Keys

2008-08-25 Thread Joerg Bruehe
sible. Foreign keys (aka "referential integrity") has a different purpose: Cross-table (or inter-table) consistency. If one table refers to (the primary key of) another table, it should be guaranteed that this reference is an existing value (does point to an existing record). If there were n

Foreign Keys

2008-08-23 Thread Steffan A. Cline
I am hoping for a little clarification/education here. My understanding of how foreign keys work is very minimal. In using MySQL for the last several years as a backend to web apps I have always managed relationships amongst the tables with auto increment primary keys myself. I have a new

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

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 TABL

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

2007-11-03 Thread Yves Goergen
l integrity and then deleted these few lines). Please tell me if there's a better way. PS: I searched a little more and found out that PostgreSQL also forbids foreign keys referencing non-unique columns (like in SQL92) due to serious bugs in the past, which is one more reason why I don't wa

Foreign keys on non-unique columns (problem)

2007-11-03 Thread Yves Goergen
Hi, 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" IN

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:51, Paul McCullagh wrote: > Hi Tim, Hello Paul > Foreign key definitions are parsed but ignored by MyISAM tables. Understood. Thanks > Try InnoDB or PBXT (http://www.primebase.com/xt) :) for the time being, I'm going to stick with MyISAM. I've got a possible solu

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:43, Rolando Edwards wrote: > SHOW INDEXES FROM `providers`; > > By the way, what version of MySQL are you using ??? 4.0.20 -- Tim Johnson <[EMAIL PROTECTED]> Palmer, Alaska, USA -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To u

Re: Retrieving foreign keys and references

2007-02-21 Thread Paul McCullagh
Hi Tim, Foreign key definitions are parsed but ignored by MyISAM tables. Try InnoDB or PBXT (http://www.primebase.com/xt) :) On Feb 21, 2007, at 9:35 AM, Tim Johnson wrote: On Wednesday 21 February 2007 17:01, Rolando Edwards wrote: SHOW CREATE TABLE providers\G Hi Rolando: That doesn't do

Re: Retrieving foreign keys and references

2007-02-21 Thread Rolando Edwards
SHOW INDEXES FROM `providers`; By the way, what version of MySQL are you using ??? - Original Message - From: "Tim Johnson" <[EMAIL PROTECTED]> To: mysql@lists.mysql.com Sent: Wednesday, February 21, 2007 3:35:46 AM (GMT-0500) Auto-Detected Subject: Re: Retrieving

Re: Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
On Wednesday 21 February 2007 17:01, Rolando Edwards wrote: > SHOW CREATE TABLE providers\G Hi Rolando: That doesn't do it on my machine (linux, ver 4.0.2) Here's what I see mysql> SHOW CREATE TABLE providers\G *** 1. row *** Table: providers

Re: Retrieving foreign keys and references

2007-02-21 Thread Rolando Edwards
SHOW CREATE TABLE providers\G - Original Message - From: "Tim Johnson" <[EMAIL PROTECTED]> To: "MySQL General Mailing List" Sent: Wednesday, February 21, 2007 2:59:35 AM (GMT-0500) Auto-Detected Subject: Retrieving foreign keys and references Hi: Below is the

Retrieving foreign keys and references

2007-02-21 Thread Tim Johnson
Hi: Below is the following relevant create table syntax CREATE Table providers( [snipped] FOREIGN KEY (status) REFERENCES provider_status(ID,title), UNIQUE KEY ID (ID) ) TYPE=MyISAM; and below is the relevant output from a describe query: mysql> show columns from providers; +---

Re: mysqldump and foreign keys

2006-04-27 Thread Frank
Nico Rittner wrote: > Hi Frank > >> what I meant was: are you sure that the tables which are in your database >> are defined correctly, i.e. have the actions? > Yes, if i try to delete or update a record which is referenced by another > i get mysql error #1217 , which should be correct. > >> mig

Re: mysqldump and foreign keys

2006-04-25 Thread Nico Rittner
Hi Frank > what I meant was: are you sure that the tables which are in your database > are defined correctly, i.e. have the actions? Yes, if i try to delete or update a record which is referenced by another i get mysql error #1217 , which should be correct. > might have been "lost" somewhere. Ca

Re: mysqldump and foreign keys

2006-04-25 Thread Frank
Nico Rittner wrote: > Hallo, > >> Sorry to ask this questions, but are you confident that the action >> clauses work properly, i.e. the tables were created correctly? > > In the case of a crash i need to restore the dump including > the on delete/update clauses. > >> What do you see when you ex

Re: mysqldump and foreign keys

2006-04-25 Thread Nico Rittner
Hallo, > Sorry to ask this questions, but are you confident that the action clauses > work properly, i.e. the tables were created correctly? In the case of a crash i need to restore the dump including the on delete/update clauses. > What do you see when you execute "show create table groups"? C

Re: mysqldump and foreign keys

2006-04-25 Thread Frank
d`), CONSTRAINT `groups_ibfk_7` FOREIGN KEY (`parent_id`) > REFERENCES `groups` (`id`), CONSTRAINT `groups_ibfk_8` FOREIGN KEY > (`r__groups_users_status__id`) REFERENCES `groups_users_status` (`id`), ) > ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='groups'; > > As you can

Re: mysqldump and foreign keys

2006-04-24 Thread Nico Rittner
groups_users_status` (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='groups'; As you can see, the foreign keys - statements are included, but without the 'action parts' ( on update,on delete ); thanks, Nico -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: mysqldump and foreign keys

2006-04-24 Thread Frank
#x27; when altering > the table with forein keys. > > Thanks, > > Nico Hi Nico, are you using the InnoDB storage engine for your tables? If not, the clauses will not be included in the dump, as only InnoDB supports foreign keys. When you create a non-InnoDB table which has a foreign key spec

mysqldump and foreign keys

2006-04-23 Thread Nico Rittner
hello, does anybody now how mysqldump handles the actions for 'on delete' and 'on update' ? In my Version 4.1.14 the action clauses are missing. When reimporting the dump, how does mysql know about the 'action' when altering the table with forein keys. Thanks, Nico -- MySQL General Mailing Li

Do foreign keys affect query speed?

2006-04-12 Thread barney
That's the whole question. Do foreign keys (FKs) affect query speed? 'Course the answer could lead to sub-questions , e.g., "If so, how best to optimize a query for them?" And I guess a corollary question would be whether implementing FKs slows down MySQL processing in g

Do foreign keys affect query speed?

2006-04-12 Thread barney
That's the whole question. Do foreign keys (FKs) affect query speed? 'Course the answer could lead to sub-questions , e.g., "If so, how best to optimize a query for them?" And I guess a corollary question would be whether implementing FKs slows down MySQL processing in g

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 bef

Foreign keys

2006-03-24 Thread João Cândido de Souza Neto
Hello everybody. I'm using php 4.4 and mysql 5.0 and i'm having the bellow issue: I've a group table and a system table, bellow this i have a group_system table that has a foreign key to group table and to system table. When a tried to delete one register in the group_system table, it gives me th

Re: Discussion: the efficiency in using foreign keys

2006-03-20 Thread Foo Ji-Haw
I've always been a believer in avoiding sql procedures, for the main reason that I want to be as database-independent as possible. I know it is less efficient, but being able to switch between MySQL, Postgre, and the new freebies from IBM, Oracle, and Microsoft is a strong advantage from the bu

Re: Errors 1005 and 1025 - but not foreign keys

2006-03-20 Thread David Felio
ect: Errors 1005 and 1025 - but not foreign keys I got an error 1025 trying to rename an InnoDB table. When I go to look in the database now, that table isn't there even though there is a .ibd file in the mysql data directory with the target name. If I try to create a table with the target nam

Re: Discussion: the efficiency in using foreign keys

2006-03-20 Thread mysql
le. Keith In theory, theory and practice are the same; in practice they are not. On Mon, 20 Mar 2006, Martijn Tonies wrote: > To: mysql@lists.mysql.com > From: Martijn Tonies <[EMAIL PROTECTED]> > Subject: Re: Discussion: the efficiency in using foreign keys > > Hi, > &g

Re: Discussion: the efficiency in using foreign keys

2006-03-19 Thread Martijn Tonies
Hi, > This is a fundamental concept in RDBMS: the use of foreign keys in > database design. > > I'd just like to poll the community here, on whether it is a best > practice, or practically essential to 'link' related tables by use of > foreign keys. >

Re: Discussion: the efficiency in using foreign keys

2006-03-19 Thread Foo Ji-Haw
Hello Keith, Thanks for responding. I was actually referring to the subject of using foreign keys, as opposed to leaving it to the calling application to do the necessary checks. In particular issues of performance, efficiency etc. IMHO, foreign keys add 'strictness' to the cons

Re: Discussion: the efficiency in using foreign keys

2006-03-19 Thread mysql
ser session ID, 'user', and then the question and the user's chosen answer are picked from the quiz_question and quiz_answer tables, using the foreign keys in the result table. I find it helps me to think of foreign keys as unique pointers to rows in other related tables. HTH

Discussion: the efficiency in using foreign keys

2006-03-19 Thread Foo Ji-Haw
Hi all, This is a fundamental concept in RDBMS: the use of foreign keys in database design. I'd just like to poll the community here, on whether it is a best practice, or practically essential to 'link' related tables by use of foreign keys. For myself, I usually do a

Re: Errors 1005 and 1025 - but not foreign keys

2006-03-17 Thread Heikki Tuuri
David, - Original Message - From: "David Felio" <[EMAIL PROTECTED]> Newsgroups: mailing.database.myodbc Sent: Thursday, March 16, 2006 11:31 PM Subject: Errors 1005 and 1025 - but not foreign keys I got an error 1025 trying to rename an InnoDB table. When I g

Errors 1005 and 1025 - but not foreign keys

2006-03-16 Thread David Felio
05. I can create it as MyISAM, however. If I try to then convert that MyISAM table to InnoDB, I get the 1025 error. I tried removing the .ibd file from the mysql data dir and that did not help. In googling the error, it seems all solutions revolve around foreign keys, but there are no foreign

בעניין: RE: FOREIGN KEYS

2006-03-11 Thread Nanu Kalmanovitz
rds! -Mensaje original- De: Nanu Kalmanovitz [mailto:[EMAIL PROTECTED] Enviado el: Viernes, 10 de Marzo de 2006 01:35 p.m. Para: mysql@lists.mysql.com Asunto: FOREIGN KEYS 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 sa

RE: FOREIGN KEYS

2006-03-10 Thread Ing. Edwin Cruz
2006 01:35 p.m. Para: mysql@lists.mysql.com Asunto: FOREIGN KEYS 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). No

Re: FOREIGN KEYS

2006-03-10 Thread SGreen
IM (InnoDB) with 3 tables > (Sites, Tracks & Pathes). > > Now, using MySQL Query Browser ver. 1.1.15, I'm trying to build FOREIGN > KEYS. > > The above tool is generating the following query: > > ALTER TABLE `tiulim`.`pathes` ADD CONSTRAINT `FK_pathes_1` FOREIGN

FOREIGN KEYS

2006-03-10 Thread Nanu Kalmanovitz
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). Now, using MySQL Query Browser ver. 1.1.15, I'm trying to buil

Re: Insert fails with Foreign Keys

2005-12-22 Thread SGreen
"Jesse" <[EMAIL PROTECTED]> wrote on 12/22/2005 05:09:12 PM: > I'm experimenting with Foreign Keys to maintain referential integrity. I > have just added a Foreign Key to one of my tables, but now when I attempt to > add a new record, I get this error: > >

Insert fails with Foreign Keys

2005-12-22 Thread Jesse
I'm experimenting with Foreign Keys to maintain referential integrity. I have just added a Foreign Key to one of my tables, but now when I attempt to add a new record, I get this error: #23000Cannot add or update a child row: a foreign key constraint fails (`fccamp/families`, CONST

Re: Can foreign keys reference tables in another database?

2005-12-16 Thread Eric Grau
in one master list of countries and the states within those countries. I'd like to keep this info in a common database, to be used by 2 or three other databases on the same host, using foreign keys to make sure that all the country/state data matches up to the master list. If I can't

Re: Can foreign keys reference tables in another database?

2005-12-16 Thread Eric Grau
of countries and the states within those countries. I'd like to keep this info in a common database, to be used by 2 or three other databases on the same host, using foreign keys to make sure that all the country/state data matches up to the master list. If I can't use foreign keys, sh

Re: Can foreign keys reference tables in another database?

2005-12-16 Thread JamesDR
e states within those countries. I'd like to keep this info in a common database, to be used by 2 or three other databases on the same host, using foreign keys to make sure that all the country/state data matches up to the master list. If I can't use foreign keys, should I just run r

Re: Can foreign keys reference tables in another database?

2005-12-16 Thread Scott Plumlee
countries. I'd like to keep this info in a common database, to be used by 2 or three other databases on the same host, using foreign keys to make sure that all the country/state data matches up to the master list. If I can't use foreign keys, should I just run regular updates to sync th

Can foreign keys reference tables in another database?

2005-12-16 Thread Scott Plumlee
I am trying to maintain one master list of countries and the states within those countries. I'd like to keep this info in a common database, to be used by 2 or three other databases on the same host, using foreign keys to make sure that all the country/state data matches up to the master

Re: need help with foreign keys, new to mysql

2005-10-18 Thread Enrique Sanchez Vela
ps, I meant to delete the note from my draft folder... sorry Enrique Sanchez. Enrique Sanchez Vela email: [EMAIL PROTECTED] - It's often easier to fight for one's ||We live in the outer space pr

Re: need help with foreign keys, new to mysql

2005-10-18 Thread Enrique Sanchez Vela
--- Kishore Jalleda <[EMAIL PROTECTED]> wrote: > check the permissions on the mysql data dir, may be > the user mysql or > who ever runs mysql does not have sufficient > privileges > Kishore Jalleda > I agree with Kishore, to elaborate his answer a little longer I would ask the following.

Re: how to list foreign keys

2005-10-07 Thread Gleb Paharenko
t;Key" colum I got "PRI" for the primary key field, somebody know >a way to get the >foreign keys ? > > "Operator" <[EMAIL PROTECTED]> wrote: -- For technical support contracts, goto https://

RE: how to list foreign keys

2005-10-05 Thread Gordon Bruce
: mysql@lists.mysql.com Subject: how to list foreign keys HI everybody I'm tryng to find a way to know if a field is a foreign key, by example if I run this describe ; in the "Key" colum I got "PRI" for the primary key field, somebody know a wa

how to list foreign keys

2005-10-05 Thread Operator
HI everybody I'm tryng to find a way to know if a field is a foreign key, by example if I run this describe ; in the "Key" colum I got "PRI" for the primary key field, somebody know a way to get the foreign keys ? Regards Daniel

Re: Backup / Restore database with foreign keys

2005-09-29 Thread Daniel Kasak
Michael Stassen wrote: Before loading the file, SET FOREIGN_KEY_CHECKS = 0; after loading the file, SET FOREIGN_KEY_CHECKS = 1; That's it! Thanks :) Even better, upgrade to a newer mysql (4.1.1+), where they are automatically added to the dump file for you. Not until the client lib

Re: Backup / Restore database with foreign keys

2005-09-29 Thread Matthew Lenz
i think you can use -K on your mysqldump and it'll put the hints in there for the mysql command to use as well - Original Message - From: "Daniel Kasak" <[EMAIL PROTECTED]> To: Sent: Thursday, September 29, 2005 7:45 PM Subject: Backup / Restore datab

Re: Backup / Restore database with foreign keys

2005-09-29 Thread Michael Stassen
Daniel Kasak wrote: Greetings. I've just hit an interesting problem. Luckily I don't actually *need* to restore from a backup right now - I'm just trying to create a database dump to submit an unrelated bug report. Anyway ... I'm using the command: mysqldump -K DATABASE_NAME > db.sql -p H

Backup / Restore database with foreign keys

2005-09-29 Thread Daniel Kasak
Greetings. I've just hit an interesting problem. Luckily I don't actually *need* to restore from a backup right now - I'm just trying to create a database dump to submit an unrelated bug report. Anyway ... I'm using the command: mysqldump -K DATABASE_NAME > db.sql -p However when I create

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

Foreign Keys

2005-09-29 Thread Nick Hird
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. Thanks

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... gi

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-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 c

foreign keys in MyISAM?

2005-09-23 Thread Jacek Becla
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? thanks, Jacek -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[E

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

Foreign keys across databases?

2005-09-19 Thread Jake Krohn
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 using care

RE: need help with foreign keys, new to mysql

2005-08-24 Thread John Gonzales
Wow, thanks both of you. It worked... =) -Original Message- From: Roger Baklund [mailto:[EMAIL PROTECTED] Sent: August 24, 2005 9:17 AM To: mysql@lists.mysql.com Cc: [EMAIL PROTECTED] Subject: Re: need help with foreign keys, new to mysql Pat Adams wrote: > On Wed, 2005-08-24 at 06

Re: need help with foreign keys, new to mysql

2005-08-24 Thread Roger Baklund
Pat Adams wrote: On Wed, 2005-08-24 at 06:11 -0500, John Gonzales wrote: CREATE TABLE `journal` ( `journal_id` int(10) unsigned NOT NULL auto_increment, [snip] CREATE TABLE comments ( comment_id INT, comment_journal_id INT, INDEX jrn_id (journal_id), Here you are defining an index name

RE: need help with foreign keys, new to mysql

2005-08-24 Thread Pat Adams
On Wed, 2005-08-24 at 06:11 -0500, John Gonzales wrote: > CREATE TABLE `journal` ( > `journal_id` int(10) unsigned NOT NULL auto_increment, > `journal_category` int(10) unsigned NOT NULL default '1', > `journal_datetime_created` timestamp NOT NULL default CURRENT_TIMESTAMP, > `journal_datet

RE: need help with foreign keys, new to mysql

2005-08-24 Thread John Gonzales
: need help with foreign keys, new to mysql Sorry to reply to my own message, but I meant to add that you can read about defining foreign key constrints in the manual <http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html>. [jg.] thanks, this is what I originally based my c

Re: need help with foreign keys, new to mysql

2005-08-20 Thread Michael Stassen
Sorry to reply to my own message, but I meant to add that you can read about defining foreign key constrints in the manual . Michael Michael Stassen wrote: There are a few possibilities here: 1. Both tables must be InnoDb

Re: need help with foreign keys, new to mysql

2005-08-20 Thread Michael Stassen
se\comments.frm' (errno: 150) You can look up what error numbers mean with perror: ~: perror 150 MySQL error code 150: Foreign key constraint is incorrectly formed i orginally created the comments table before i read about FOREIGN KEYS, so i tried executing the following command: ALTER

RE: need help with foreign keys, new to mysql

2005-08-20 Thread John Gonzales
? -jg. -Original Message- From: Thurgood Alex [mailto:[EMAIL PROTECTED] Sent: August 20, 2005 3:22 AM To: John Gonzales Cc: mysql@lists.mysql.com Subject: Re: need help with foreign keys, new to mysql Le vendredi 19 août 2005 à 21:09 -0500, John Gonzales a écrit : Hi John, > #1005 - Can't

Re: need help with foreign keys, new to mysql

2005-08-20 Thread Thurgood Alex
Le vendredi 19 août 2005 à 21:09 -0500, John Gonzales a écrit : Hi John, > #1005 - Can't create table '.\mydatabase\comments.frm' (errno: 150) > I've seen this error before. > now before i go and do something stupid, i thought i might ask for some help > on this issue :D both my blog and comm

RE: need help with foreign keys, new to mysql

2005-08-20 Thread John Gonzales
honestly... i don't even know. =( i'm new to mysql... how would i check? -jg -Original Message- From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] Sent: August 20, 2005 2:18 AM To: mysql@lists.mysql.com Subject: Re: need help with foreign keys, new to mysql Yes but is

Re: need help with foreign keys, new to mysql

2005-08-20 Thread Jasper Bryant-Greene
need help with foreign keys, new to mysql check the permissions on the mysql data dir, may be the user mysql or who ever runs mysql does not have sufficient privileges Kishore Jalleda On 8/19/05, John Gonzales <[EMAIL PROTECTED]> wrote: i am creating my own little blog and i am trying

RE: need help with foreign keys, new to mysql

2005-08-20 Thread John Gonzales
i am logged in as root -JG. -Original Message- From: Kishore Jalleda [mailto:[EMAIL PROTECTED] Sent: August 19, 2005 10:35 PM To: John Gonzales Cc: mysql@lists.mysql.com Subject: Re: need help with foreign keys, new to mysql check the permissions on the mysql data dir, may be the user

Re: need help with foreign keys, new to mysql

2005-08-19 Thread Kishore Jalleda
the primary key of my blog table as a foreign key. i've tried the > only two ways that i know how and both ways yielded the same error: > > #1005 - Can't create table '.\mydatabase\comments.frm' (errno: 150) > > i orginally created the comments table before i

need help with foreign keys, new to mysql

2005-08-19 Thread John Gonzales
x27; (errno: 150) i orginally created the comments table before i read about FOREIGN KEYS, so i tried executing the following command: ALTER TABLE comments ADD FOREIGN KEY(comment_journal_id) REFERENCES journal(journal_id) ON DELETE CASCADE ON UPDATE CASCADE; which resulted with the same error as

FW: what WHERE how... i am confused: extra instances of foreign keys are being problematic

2005-06-27 Thread Duncan Westfall
I am having trouble with this small bit of sql I am using for a homepage. I need to select information on the next two events from two separate tables; tblevents (which holds event related info), and tbleventdate (which holds info related to each date, including times and informatio

what WHERE how... i am confused: extra instances of foreign keys are being problematic

2005-06-27 Thread Duncan Westfall
I am having trouble with this small bit of sql I am using for a homepage. I need to select information on the next two events from two separate tables; tblevents (which holds event related info), and tbleventdate (which holds info related to each date, including times and informatio

RE: Primary and Foreign Keys (Follow Up)

2005-06-15 Thread George Sexton
Kuhn > Cc: mysql@lists.mysql.com > Subject: Re: Primary and Foreign Keys (Follow Up) > > Hello. I appreciate your input. To clarify, I will provide you with an > example: > > I have a table called business and another one called > food_business. The > field business_id is a pr

Re: Primary and Foreign Keys (Follow Up)

2005-06-15 Thread Asad Habib
Hello. I appreciate your input. To clarify, I will provide you with an example: I have a table called business and another one called food_business. The field business_id is a primary key of table business and a foreign key of table food_business. In this case, the foreign key is unique and althou

Re: Primary and Foreign Keys (Follow Up)

2005-06-15 Thread Stefan Kuhn
If your FK really is unique, you don't need two tables. Example First table Second Table ID FK 1 1 2 2 3 3 ... So you can make this one table. On other words, it would be a one-to-one relation. And this would be one table. Only with a one-

Primary and Foreign Keys (Follow Up)

2005-06-15 Thread Asad Habib
As a follow up to my question, I did want to mention that the foreign key I am using is unique. - Asad -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Primary and Foreign Keys

2005-06-15 Thread Asad Habib
Is it good practice to have a primary key for a table even though the table has a foreign key that is the primary key of another table? If so, why is this the case? I would appreciate if you point me to some resources that point out the advantages and disadvantages of both approaches. Thank you. -

Re: Foreign keys - No action - Errors

2005-05-23 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 key

Foreign keys - No action - Errors

2005-05-23 Thread Sven Åke Johansson
I have some problem with Foreign Key settings. I use MySQL 4.12, MySQL Query Browser 4.16 and Windows XP. Restrict and Cascade is Ok but when I try to set No action it wont work. Sometimes there is no error message and it seams that the change is saved. But when I check there is no changes. W

Re: mysqldump and Foreign Keys

2005-02-03 Thread Gleb Paharenko
les up in alphabetic order, including the > table create statements. The problem is that if foreign keys exist on > the tables, the reload will not work unless the backup file is hand > edited to insure that tables depended upon are created first. Is there a > way around this? If not,

  1   2   3   4   5   >