Re: Foreign-key reference

2014-01-07 Thread hsv
2014/01/06 14:24 -0500, Morgan Tocker You might be hitting: Important The inline REFERENCES specifications where the references are defined as part of the column specification are silently ignored. MySQL only accepts REFERENCES clauses defined as part of a separate FOREIGN KEY specification.

Re: Foreign-key reference

2014-01-07 Thread Morgan Tocker
Ugh, that seems quite right. Now, why did they do that? It was added for compatibility. A separate specification is less convenient, and also less transparent. Please click affects me on http://bugs.mysql.com/bug.php?id=47771 - Morgan -- MySQL General Mailing List For list archives:

Re: Foreign-key reference

2014-01-06 Thread Morgan Tocker
On 1/6/2014, 12:21 PM, h...@tbbs.net wrote: Are INNODB foreign-key references ignored in 5.6? You might be hitting: Important The inline REFERENCES specifications where the references are defined as part of the column specification are silently ignored. MySQL only accepts REFERENCES clauses

Re: Foreign-key reference

2014-01-06 Thread Reindl Harald
Am 06.01.2014 18:21, schrieb h...@tbbs.net: Are INNODB foreign-key references ignored in 5.6? why should they? http://www.catb.org/~esr/faqs/smart-questions.html#beprecise signature.asc Description: OpenPGP digital signature

Re: Foreign key on multiple columns

2013-03-21 Thread Peter Brawley
On 2013-03-21 8:12 AM, Norah Jones wrote: I'm trying to create a foreign key on two columns but getting error... Here's what I tried: CREATE TABLE test2 ( ID INT NOT NULL AUTO_INCREMENT, col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (ID), CONSTRAINT

Re: Foreign key on multiple columns

2013-03-21 Thread shawn green
On 3/21/2013 12:43 PM, Abhishek Choudhary wrote: CREATE TABLE test2 ( ID INT NOT NULL AUTO_INCREMENT, col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (ID), CONSTRAINT fk FOREIGN KEY (col1, col2) REFERENCES test1(ID,

Re: Foreign key on multiple columns

2013-03-21 Thread Abhishek Choudhary
...@earthlink.net To: mysql@lists.mysql.com Cc: Sent: Thursday, 21 March 2013 8:14 PM Subject: Re: Foreign key on multiple columns On 2013-03-21 8:12 AM, Norah Jones wrote: I'm trying to create a foreign key on two columns but getting error... Here's what I tried:       CREATE TABLE test2

Re: Foreign-key naming

2012-12-12 Thread hsv
When I wrote my comment after Larry Martell s problem, I already suspected it was somewhat out of place because to his problem it did not apply. 2012/12/12 08:25 -0500, Shawn Green This is a perfectly acceptable naming convention to use. For example if you have a field on the `art` table that

Re: Foreign key and uppercase / lowercase values

2012-06-18 Thread GF
, June 15, 2012 12:45 AM To: Rick James Cc: Shawn Green; mysql@lists.mysql.com Subject: Re: Foreign key and uppercase / lowercase values I think the following might give complete information (I removed some columns not involved in the problem) Server version: 5.1.49-3 (Debian) SET

Re: Foreign key and uppercase / lowercase values

2012-06-15 Thread GF
I think the following might give complete information (I removed some columns not involved in the problem) Server version: 5.1.49-3 (Debian) SET collation_connection = utf8_unicode_ci; Query OK, 0 rows affected (0.00 sec) show variables like '%colla%';

RE: Foreign key and uppercase / lowercase values

2012-06-15 Thread Rick James
You are very close to a standalone test case. Please create such. Then post it on bugs.mysql.com . -Original Message- From: GF [mailto:gan...@gmail.com] Sent: Friday, June 15, 2012 12:45 AM To: Rick James Cc: Shawn Green; mysql@lists.mysql.com Subject: Re: Foreign key

Re: Foreign key and uppercase / lowercase values

2012-06-15 Thread Shawn Green
Subject: Re: Foreign key and uppercase / lowercase values I think the following might give complete information (I removed some columns not involved in the problem) Server version: 5.1.49-3 (Debian) SET collation_connection = utf8_unicode_ci; Query OK, 0 rows affected ... Before he submits

RE: Foreign key and uppercase / lowercase values

2012-06-15 Thread Rick James
: Friday, June 15, 2012 12:06 PM To: Rick James Cc: GF; mysql@lists.mysql.com Subject: Re: Foreign key and uppercase / lowercase values On 6/15/2012 1:00 PM, Rick James wrote: You are very close to a standalone test case. Please create such. Then post it on bugs.mysql.com . -Original

Re: Foreign key and uppercase / lowercase values

2012-06-15 Thread Shawn Green
On 6/15/2012 3:19 PM, Rick James wrote: Those refer _only_ to German 'ß' LATIN SMALL LETTER SHARP S. The example GF gave did not involve that character. To my knowledge, that is the only case where MySQL changed a collation after releasing it. Yes, it has been the only occurrence.

Re: Foreign key and uppercase / lowercase values

2012-06-15 Thread Walter Tross
At 16.40 15/06/2012 -0400, Shawn Green wrote: On 6/15/2012 3:19 PM, Rick James wrote: Those refer _only_ to German 'ß' LATIN SMALL LETTER SHARP S. The example GF gave did not involve that character. To my knowledge, that is the only case where MySQL changed a collation after releasing it.

RE: Foreign key and uppercase / lowercase values

2012-06-13 Thread Rick James
: Foreign key and uppercase / lowercase values Good morning. The application is Java. The database version is : Server version: 5.1.49-3 (Debian) This is an example of the problem: __ mysql SET collation_connection = utf8_unicode_ci; Query OK, 0 rows affected (0.00 sec

Re: Foreign key and uppercase / lowercase values

2012-06-12 Thread GF
Good morning. The application is Java. The database version is : Server version: 5.1.49-3 (Debian) This is an example of the problem: __ mysql SET collation_connection = utf8_unicode_ci; Query OK, 0 rows affected (0.00 sec) mysql show variables like '%colla%';

Re: Foreign key and uppercase / lowercase values

2012-05-16 Thread Ananda Kumar
why are not using any where condition in the update statment On Wed, May 16, 2012 at 1:24 PM, GF gan...@gmail.com wrote: Good morning, I have an application where the user ids were stored lowercase. Some batch import, in the user table some users stored a uppercase id, and for some

RE: Foreign key and uppercase / lowercase values

2012-05-16 Thread Rick James
... for further discussion. Instead of changing the data, why not do the casefolding as you SELECT into Java? -Original Message- From: Ananda Kumar [mailto:anan...@gmail.com] Sent: Wednesday, May 16, 2012 3:43 AM To: GF Cc: mysql@lists.mysql.com Subject: Re: Foreign key and uppercase / lowercase

Re: Foreign key and uppercase / lowercase values

2012-05-16 Thread Shawn Green
Hello Ananda, On 5/16/2012 6:42 AM, Ananda Kumar wrote: why are not using any where condition in the update statment WHERE clauses are not required. Performing a command without one will affect ever row on the table. On Wed, May 16, 2012 at 1:24 PM, GFgan...@gmail.com wrote: Good

RE: Foreign Key Error

2011-02-14 Thread Gavin Towey
or column types in the table and the referenced table do not match for constraint The columns Parent and Child are signed integers and ID is unsigned. Regards, Gavin Towey -Original Message- From: Victor Subervi [mailto:victorsube...@gmail.com] Sent: Monday, February 14, 2011 3:09 PM

Re: Foreign Key Error

2011-02-14 Thread Victor Subervi
Thank you! V On Mon, Feb 14, 2011 at 9:08 PM, Gavin Towey gto...@ffn.com wrote: or column types in the table and the referenced table do not match for constraint The columns Parent and Child are signed integers and ID is unsigned. Regards, Gavin Towey -Original Message- From:

Re: Foreign key with more columns and a constant value

2010-10-24 Thread Johan De Meersman
The idea of a foreign key is that is is, well, a *foreign key* :-) It's meant to match up data that is in one table with data that is in another table, and a constant obviously isn't data in your table. To be precise, what you specify in your constraint are not even fields, but *indices* - and a

Re: Foreign Key Problem

2010-06-22 Thread Victor Subervi
Problem solved. I tried everything that *should* have worked and didn't. Then I just wiped the test database and started with everything *fixed* (all engine=innodb, all keys of same type, etc.) and it all worked. V

Re: Foreign Key Problem

2010-06-22 Thread jayabharath
Hi Victor, The actual problem is with the key field. Flights.pilot_id is set to INT NOT NULL and you had specified Pilots.id to INT NULL. You have to change both the columns to NULL or else NOT NULL to avoid the error. Regards, Jay MySQL DBA Datavail CORP On Tue, Jun 22, 2010 at 7:45 PM,

Re: Foreign Key Problem

2010-06-22 Thread Victor Subervi
On Tue, Jun 22, 2010 at 11:53 AM, jayabharath jbhara...@gmail.com wrote: Hi Victor, The actual problem is with the key field. Flights.pilot_id is set to INT NOT NULL and you had specified Pilots.id to INT NULL. You have to change both the columns to NULL or else NOT NULL to avoid the

Re: Foreign Key Problem

2010-05-22 Thread Victor Subervi
This is just for the sake of future googlers of this thread. The correct mysql command is: ursor.execute('create table if not exists Passengers (id int(11) auto_increment primary key, flights_id int(11) not null, customer_id int(11) not null, foreign key (flights_id) references Flights (id),

Re: Foreign Key Problem

2010-05-20 Thread Victor Subervi
On Wed, May 19, 2010 at 12:02 PM, Shawn Green shawn.l.gr...@oracle.comwrote: Victor Subervi wrote: On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.com wrote: Shawn Green wrote: look again closely at your FK definitions. The pattern should be FOREIGN KEY

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Tue, May 18, 2010 at 2:23 PM, Shawn Green shawn.l.gr...@oracle.comwrote: Shawn Green wrote: I may be confused but how can the ID of the Passengers table be both the ID of the Flight they are taking and their Customer ID at the same time?

Re: Foreign Key Problem

2010-05-19 Thread Shawn Green
Victor Subervi wrote: On Tue, May 18, 2010 at 2:23 PM, Shawn Green shawn.l.gr...@oracle.comwrote: Shawn Green wrote: I may be confused but how can the ID of the Passengers table be both the ID of the Flight they are taking and their Customer ID at the same time?

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.comwrote: Shawn Green wrote: AH! that's your mistake. You think that creating the FK will also create the column. That does not happen. You have to define the table completely before you can associate the columns on this

Re: Foreign Key Problem

2010-05-19 Thread Shawn Green
Victor Subervi wrote: On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.comwrote: Shawn Green wrote: AH! that's your mistake. You think that creating the FK will also create the column. That does not happen. You have to define the table completely before you can associate the

Re: Foreign Key Problem

2010-05-18 Thread Johan De Meersman
You're not specifying an engine, and the default is MyISAM, which doesn't support foreign keys and will likely silently ignore requests for them. Can you confirm that you've changed the default engine to InnoDB ? On Tue, May 18, 2010 at 3:44 PM, Victor Subervi victorsube...@gmail.comwrote: Hi;

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
On Tue, May 18, 2010 at 10:06 AM, Johan De Meersman vegiv...@tuxera.bewrote: You're not specifying an engine, and the default is MyISAM, which doesn't support foreign keys and will likely silently ignore requests for them. Can you confirm that you've changed the default engine to InnoDB ?

Re: Foreign Key Problem

2010-05-18 Thread Johan De Meersman
On Tue, May 18, 2010 at 6:00 PM, Victor Subervi victorsube...@gmail.comwrote: So apparently it didn't like my foreign key. Do I need to do something with the table I'm referencing or what? TIA. Well, quickfix is to convert your tables to innoDB, starting with the lowest-level (foreign-key

Re: Foreign Key Problem

2010-05-18 Thread Shawn Green
Johan De Meersman wrote: On Tue, May 18, 2010 at 6:00 PM, Victor Subervi victorsube...@gmail.comwrote: So apparently it didn't like my foreign key. Do I need to do something with the table I'm referencing or what? TIA. Well, quickfix is to convert your tables to innoDB, starting with the

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
On Tue, May 18, 2010 at 1:09 PM, Shawn Green shawn.l.gr...@oracle.comwrote: Johan De Meersman wrote: For additional details about failed FK attempts, check the error details in the SHOW INNODB STATUS report. I get this: 100518 10:26:22 Error in foreign key constraint of table

Re: Foreign Key Problem

2010-05-18 Thread Shawn Green
Victor Subervi wrote: On Tue, May 18, 2010 at 1:09 PM, Shawn Green shawn.l.gr...@oracle.com mailto:shawn.l.gr...@oracle.com wrote: Johan De Meersman wrote: For additional details about failed FK attempts, check the error details in the SHOW INNODB STATUS report. I get this:

SOLVED: Re: Foreign Key Issue

2009-03-26 Thread John Daisley
Sorry all, I was being a dummy! Missed the unsigned attribute off the foreign key columns on the problem tables. Regards Hi, I have the script below to create 5 tables. Three of them create fine but two return an error of 150 which I understand to be a foreign key issue, however I can't

Re: SOLVED: Re: Foreign Key Issue

2009-03-26 Thread Claudio Nanni
I had the same problem and was going crazy, the ket/foreign key fields must be exactly the same. I 'forward' engineered the database with MySQL Workbench and was almost posting a bug! Cheers Claudio 2009/3/26 John Daisley john.dais...@mypostoffice.co.uk Sorry all, I was being a dummy!

Re: Foreign key constraints - Known issues ?

2007-07-19 Thread Martijn Tonies
I just wanted to know whether there are any known issues in defining and using Foreign key constraints in MySQL 4 and MySQL 5. To be specific, are there any issues on using ON DELETE CASCADE and ON UPDATE CASCADE? Would there be any performance issues when we define Foreign key constraints? We

Re: Foreign Key MATCH constraint

2006-11-10 Thread Giorgio Zarrelli
Alle 14:04, giovedì 9 novembre 2006, Heikki Tuuri ha scritto: Giorgio, InnoDB only implements MATCH SIMPLE. MySQL/InnoDB ignores the MATCH clause that you specify in the foreign key constraint definition. Thanks a lot :-) Giorgio -- MySQL General Mailing List For list archives:

Re: Foreign Key MATCH constraint

2006-11-09 Thread Heikki Tuuri
Giorgio, InnoDB only implements MATCH SIMPLE. MySQL/InnoDB ignores the MATCH clause that you specify in the foreign key constraint definition. http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt A referential constraint is satisfied if one of the following con-

re: foreign key not able to be made

2006-10-05 Thread James Black
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am curious what I am doing wrong. I am using mysql-5.0.13, on Solaris. The error I get, on the first alter table, is: ERROR 1005 (HY000) at line 70: Can't create table './FlashcardProto_production/#sql-151_f5d.frm' (errno: 150) Any help would be

Re: re: foreign key not able to be made

2006-10-05 Thread Dan Buettner
James, you may have a typo in your SQL, actually in the the frst two ALTER TABLE statements. You posted: ALTER TABLE `cardfaces` ADD CONSTRAINT `fk_card_deck` FOREIGN KEY (`card_id`) references card(`id`); ALTER TABLE `cards` ADD CONSTRAINT `fk_card_deck` FOREIGN KEY (`deck_id`)

Re: foreign key creation on MyISAM storage engine

2006-03-28 Thread Martijn Tonies
Hello Taco, I previously tried this same question on the GUI tool list, but not much traffic there, so I thought I'd give it a go here. I've been reading some articles that suggest I should be able to create a relationship on a MyISAM table, it would be great if someone could confirm or deny

Re: foreign key creation on MyISAM storage engine

2006-03-28 Thread Greg 'groggy' Lehey
On Tuesday, 28 March 2006 at 10:09:16 +0200, Martijn Tonies wrote: Hello Taco, I previously tried this same question on the GUI tool list, but not much traffic there, so I thought I'd give it a go here. I've been reading some articles that suggest I should be able to create a relationship on

Re: Foreign Key with constant?

2005-12-27 Thread Danny Stolle
Hi jesse, You can only set the reference in your constraint: ... ADD FOREIGN KEY (id) references table(id) ... In this case you will get an inconsistent database. Dont reference the two tables Campers and Counselers with the ActivitySelections table, but use two tables in which you put the

Re: Foreign Key with constant?

2005-12-27 Thread Jesse
, December 27, 2005 6:27 AM Subject: Re: Foreign Key with constant? Hi jesse, You can only set the reference in your constraint: ... ADD FOREIGN KEY (id) references table(id) ... In this case you will get an inconsistent database. Dont reference the two tables Campers and Counselers

Re: Foreign Key Help

2005-12-22 Thread SGreen
Jesse [EMAIL PROTECTED] wrote on 12/22/2005 02:51:21 PM: I am trying to add referential integrity to my database. I'm trying to add a foreign key reference to one of my tables, but I'm getting an error when I try to do so. Here's what I'm executing: ALTER TABLE Campers ADD CONSTRAINT

Re: Foreign Key Help

2005-12-22 Thread Jesse
] To: Jesse Cc: mysql@lists.mysql.com Sent: Thursday, December 22, 2005 3:00 PM Subject: Re: Foreign Key Help Jesse [EMAIL PROTECTED] wrote on 12/22/2005 02:51:21 PM: I am trying to add referential integrity to my database. I'm trying to add a foreign key reference to one of my

Re: Foreign key support in MyISAM

2005-09-30 Thread Jacek Becla
Hi, I had asked similar question few days ago, and then checked with the developers as no one was able to answer on this mailing list. I was told it is very likely we'll get it in 5.2. Jacek Sujay Koduri wrote: does anyone have an idea when mysql guys are going to include foreign key

Re: Foreign key support in MyISAM

2005-09-30 Thread Josh Trutwin
On Fri, 30 Sep 2005 13:08:31 -0700 Jacek Becla [EMAIL PROTECTED] wrote: Hi, I had asked similar question few days ago, and then checked with the developers as no one was able to answer on this mailing list. I was told it is very likely we'll get it in 5.2. Thanks - now that 5.0 is release

Re: foreign key constrain

2005-08-31 Thread Ady Wicaksono
When you found this error, go to your MySQL database and do SHOW INNODB STATUS there will be an information about last foreign key error Thx joshua pereira wrote: hello when im inserting data to my database this error occurs javax.servlet.ServletException: Cannot add or update a child row:

RE: Foreign key constraint problem

2005-06-14 Thread Gordon Bruce
In some hierarchies I have seen people put the the current id in the parent_ID Field {basicaly pointing to them self} to represent the top of the hierarchy. I don't know how much this would affect the rest of your application but it would get rid of the null's -Original Message- From:

Re: Foreign key constraint problem

2005-06-14 Thread SGreen
Marcus Bointon [EMAIL PROTECTED] wrote on 06/14/2005 12:37:18 PM: I have a table that uses a self join to represent simple hierarchies. I have a parent_id field that contains a reference to the same table's id field. Not all items have a parent, so parent_id is nullable. The problem I run

Re: Foreign key constraint problem

2005-06-14 Thread Marcus Bointon
On 14 Jun 2005, at 17:52, [EMAIL PROTECTED] wrote: My suggestion, lame as it is, would be to use a 0 (zero) in place of the NULL value. That way, you always have a valid entry for PARENT_ID, you can still identify the tops of the trees (parent_id=0) and you have gotten around the

Re: Foreign Key Restriction

2005-05-06 Thread Oliver Hirschi
Partha Dutta [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] You can turn off foreign key restrictions within your session: SET SESSION foreign_key_checks = 0; Then later, turn them back on using SET SESSION foreign_key_checks = 1; I saw, that the tables on my

Re: Foreign Key Restriction

2005-05-06 Thread Michael Stassen
Oliver Hirschi wrote: Partha Dutta [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] You can turn off foreign key restrictions within your session: SET SESSION foreign_key_checks = 0; Then later, turn them back on using SET SESSION foreign_key_checks = 1; I saw, that the tables on

Re: Foreign Key Restriction

2005-05-04 Thread Oliver Hirschi
Oliver Hirschi [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi I updated mySQL 4.0.8 to 4.1.1 and I have now problems with foreign key retrictions. Is it right, that mySQL 4.1.x has something changed due to the foreign key restriction? Is there an option to turn off the

RE: Foreign Key Restriction

2005-05-04 Thread Partha Dutta
/certification -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Oliver Hirschi Sent: Wednesday, May 04, 2005 10:50 AM To: mysql@lists.mysql.com Subject: Re: Foreign Key Restriction Oliver Hirschi [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi I

Re: foreign key design stratgies

2005-04-11 Thread Rhino
- Original Message - From: Steve Lefevre [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 12:26 AM Subject: foreign key design stratgies Hey folks - I'm having a little problem understanding ON DELETE foreign key constraints. Here's my options from the

Re: Foreign Key Error 1005:150

2004-12-06 Thread steven . p . long
Michael, Thank you for your reply. Here is a bit more info. I changed the default table type to innodn in the my.ini file before creating the database, so all tables are innodb. I tried the create statements with and without explicit index clauses with all permutations - same result each

RE: Foreign Key Error 1005:150

2004-12-06 Thread Kocsis, Bela
Dear Steve! You must set the column address_id as primary key in the table person_address. That should solve your problem. Generally table, you want to join with foreign key, should have primary key. The primary key should include the column that you use for the

Re: Foreign Key Error 1005:150

2004-12-06 Thread Heikki Tuuri
Steve, - Original Message - From: [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Monday, December 06, 2004 1:00 PM Subject: Re: Foreign Key Error 1005:150 --NextPart_Webmail_9m3u9jl4l_14802_1102330771_0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Michael, Thank

Re: Foreign Key Error 1005:150

2004-12-05 Thread Heikki Tuuri
Steve, which MySQL version did you use? Both statements work with MySQL-4.1.8 on Linux. [EMAIL PROTECTED]:~/mysql-4.1/client ./mysql test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.8-debug-log Type 'help;' or '\h' for help. Type

Re: Foreign Key Error 1005:150

2004-12-05 Thread Michael Stassen
Something is wrong, but it's hard to say what. It seems unlikely you entered exactly those commands and got an error only on the last ALTER TABLE. First, you need InnoDB tables to support foreign keys, but you don't specify the table engine in your CREATE statements. The default is MyISAM,

Re: Foreign Key Preventing Publishing to Web?

2004-11-26 Thread andrebras
hi, in the script you have CONSTRAINT `0_132` FOREIGN KEY ( `SCode` ) REFERENCES `statesarticles` ( `SCode` ) ON UPDATE CASCADE and this code it's a definition of the foreign key. run the script without this part of the code. Citando David Blomstrom [EMAIL PROTECTED]: When I was first

Re: Foreign Key Preventing Publishing to Web?

2004-11-26 Thread David Blomstrom
--- [EMAIL PROTECTED] wrote: hi, in the script you have CONSTRAINT `0_132` FOREIGN KEY ( `SCode` ) REFERENCES `statesarticles` ( `SCode` ) ON UPDATE CASCADE and this code it's a definition of the foreign key. run the script without this part of the code. * * * * * * * * * * Thank

Re: Foreign Key Preventing Publishing to Web?

2004-11-26 Thread David Blomstrom
Please disregard my last post. I found another workaround - I saved the database table on my computer in an unzipped format, and I was able to export it to my website. It looks good! http://www.geoworld.org/north_america/usa/az/counties/index.php Thanks.

Re: Foreign Key

2004-11-03 Thread Martijn Tonies
Hi all, I whould like to know if there is a way to create Foreign Keys between Parent and Child table, I realy dont know if is it possible to do it and if OK, how will be a simple SQL code of it. Only for InnoDB tables - see:

Re: Foreign key error

2004-10-13 Thread SGreen
run the command: SHOW INNODB STATUS; whenever you get those errors and it will give you more details. Shawn Green Database Administrator Unimin Corporation - Spruce Pine Herman Scheepers [EMAIL PROTECTED] wrote on 10/13/2004 03:42:34 PM: I tried to create a foreign key using: ALTER TABLE

Re: Foreign key error

2004-10-13 Thread Michael Stassen
:perror 150 MySQL error: 150 = Foreign key constraint is incorrectly formed This is usually due to a missing index. To make a foreign key, both of the involved columns must come first in an index. Do you have indexes on msg_recipients.recipient_member_id and members.id? Michael [EMAIL

Re: foreign key problem

2004-10-04 Thread SGreen
Whenever you get an INNODB error, you can get more details by running a SHOW INNODB STATUS. A foreign key means that a value must exist in one table before it can be used as a value in another table. That's probably why you couldn't add a record to Table2 before you had a value in Table1. The

Re: foreign key problem

2004-10-03 Thread Stuart Felenstein
I think I may have discovered one of my issues, is memberID in Table2 was primary key. Should not have been. As far as the error messages in removing key, I'm still unsure. Stuart --- Stuart Felenstein [EMAIL PROTECTED] wrote: Two tables: Table1 [innodb] userID. addtlfields.

Re: foreign key constraints

2004-07-22 Thread Brian Mansell
Sergei, Check out Paul DuBois' book MySQL - The Definitive Guide (2nd edition). It has a few good chapters that discuss foreign key constraints. --bmansell Brian E. Mansell MySQL Professional On Thu, 22 Jul 2004 13:06:07 -0700, Sergei Skarupo [EMAIL PROTECTED] wrote: Hi everyone, I'd

RE: Foreign Key

2004-07-13 Thread Victor Pendleton
You should take a look at using InnoDb table types. -Original Message- From: Everton Sanga To: [EMAIL PROTECTED] Sent: 7/13/04 8:26 PM Subject: Foreign Key Hi all, this is my first post, and I whould like to know if there is a way to create Foreign Key´s between Parent and Child table, I

Re: Foreign Key Constraints

2004-05-28 Thread Martijn Tonies
Hi, ok - I've checked. Why not? What's wrong with this: BORROWER BorrowerID BOOKS BookID BorrowerID (nullable) FK from Books.BorrowerID to Borrower.BorrowerID I haven't checked, but this _should_ be possible. With regards, Its a foreign key, you can

Re: Foreign Key Constraints

2004-05-28 Thread Jeff Smelser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 28 May 2004 02:57 am, Martijn Tonies wrote: Hi, ok - I've checked. Why not? What's wrong with this: BORROWER BorrowerID BOOKS BookID BorrowerID (nullable) FK from Books.BorrowerID to

Re: Foreign Key Constraints

2004-05-28 Thread Martijn Tonies
Hi Jeff, ok - I've checked. Why not? What's wrong with this: BORROWER BorrowerID BOOKS BookID BorrowerID (nullable) FK from Books.BorrowerID to Borrower.BorrowerID I haven't checked, but this _should_ be possible. With

Re: Foreign Key Constraints

2004-05-28 Thread Michael Stassen
Martijn Tonies wrote: Hi Jeff, snip CREATE TABLE inno2 ( PK_Col Integer NOT NULL DEFAULT 0, Child_Col Integer, PRIMARY KEY (PK_Col) ) TYPE=InnoDB ; CREATE INDEX I_Inno2_ChildCol ON inno2(Child_Col); CREATE TABLE inno3 ( PK_Col Integer NOT NULL DEFAULT 0, Child_Col Integer, PRIMARY KEY (PK_Col) )

Re: Foreign Key Constraints

2004-05-28 Thread Michael Stassen
Michael Stassen wrote: Martijn Tonies wrote: Hi Jeff, snip In this example, inno3.PK_Col references inno2.Child_Col, so the 2nd and 3rd statements are failing because they try to set inno3.PK_Col to values not present in inno2.Child_Col. The NULLs are irrelevant. Michael Perhaps this is

Re: Foreign Key Constraints

2004-05-28 Thread Martijn Tonies
Hi, Martijn Tonies wrote: Hi Jeff, snip In this example, inno3.PK_Col references inno2.Child_Col, so the 2nd and 3rd statements are failing because they try to set inno3.PK_Col to values not present in inno2.Child_Col. The NULLs are irrelevant. Woops, right Michael - got that

Re: Foreign Key Constraints

2004-05-28 Thread Jeff Smelser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 28 May 2004 11:50 am, Martijn Tonies wrote: This makes perfectly sense. So, once again I dare to ask: what's the problem with NULLable Foreign Keys? It works fine :-) (now, who was it that said that FKs should be entered/exist

Re: Foreign Key Constraints

2004-05-28 Thread Jeff Smelser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 28 May 2004 11:50 am, Martijn Tonies wrote: This makes perfectly sense. So, once again I dare to ask: what's the problem with NULLable Foreign Keys? It works fine :-) (now, who was it that said that FKs should be entered/exist

Re: Foreign Key Constraints

2004-05-28 Thread Martijn Tonies
This makes perfectly sense. So, once again I dare to ask: what's the problem with NULLable Foreign Keys? It works fine :-) (now, who was it that said that FKs should be entered/exist always?) With regards, Here is the issue... If you go back to what he was doing this insert

Re: Foreign Key Constraints

2004-05-27 Thread Robert J Taylor
[EMAIL PROTECTED] wrote: Hi, I am trying to use the foreign key constraints from InnoDB and creating indexes is a requirement for foreign key. The problem is that by creating index for my foreign key, it does not allow my foreign key to have null or blank values which my records will have. For eg.

Re: Foreign Key Constraints

2004-05-27 Thread Colin Bull
[EMAIL PROTECTED] wrote: Hi, I am trying to use the foreign key constraints from InnoDB and creating indexes is a requirement for foreign key. The problem is that by creating index for my foreign key, it does not allow my foreign key to have null or blank values which my records will have. For eg.

Re: Foreign Key Constraints

2004-05-27 Thread Martijn Tonies
Hi, On Wednesday 26 May 2004 11:22 pm, [EMAIL PROTECTED] wrote: Hi, I am trying to use the foreign key constraints from InnoDB and creating indexes is a requirement for foreign key. The problem is that by creating index for my foreign key, it does not allow my foreign key to have null or

Re: Foreign Key Constraints

2004-05-27 Thread SGreen
You could create a special borrower account to signify that it is not loaned out and assign that to the book. If this is for a library system (multiple branches) you could create one account for each branch. That way you would know where the book is at all times, borrowed or not ;-) Shawn

Re: Foreign Key Constraints

2004-05-27 Thread Jeff Smelser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 27 May 2004 03:00 am, Martijn Tonies wrote: Why not? What's wrong with this: BORROWER BorrowerID BOOKS BookID BorrowerID (nullable) FK from Books.BorrowerID to Borrower.BorrowerID I haven't checked, but this _should_ be

Re: Foreign Key Constraints

2004-05-27 Thread Martijn Tonies
Hi, Why not? What's wrong with this: BORROWER BorrowerID BOOKS BookID BorrowerID (nullable) FK from Books.BorrowerID to Borrower.BorrowerID I haven't checked, but this _should_ be possible. With regards, Its a foreign key, you can not null foreign keys.. Thats the

Re: Foreign Key Constraints

2004-05-26 Thread Jeff Smelser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 26 May 2004 11:22 pm, [EMAIL PROTECTED] wrote: Hi, I am trying to use the foreign key constraints from InnoDB and creating indexes is a requirement for foreign key. The problem is that by creating index for my foreign key, it does not

Re: Foreign Key problems

2004-05-18 Thread Daniel Kasak
Sonj McCoy wrote: Hello Everyone, I am having problems with foreign keys in MySQL InnoDB type databases. For some reason, when adding a new record within an MS Access subform (based on a query of two tables (parent table and child table), the corresponding foreign key column in the child table

Re: Foreign key question

2004-05-14 Thread David Blomstrom
--- Randy Clamons [EMAIL PROTECTED] wrote: Primary key names start with pk_, unique indexes start with uk_, other indexes start wiht ix_. That's a good tip. What if just named the primary key pk and the foreign key fk. Would you run into trouble if you're working with two or three tables, and

Re: Foreign Key Renaming Problem

2004-05-13 Thread Heikki Tuuri
Message - From: Victoria Reznichenko [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, May 12, 2004 4:30 PM Subject: Re: Foreign Key Renaming Problem Deepak Vishwanathan [EMAIL PROTECTED] wrote: I have a table named t1 with a column x1 which is the primary key

Re: Foreign Key Renaming Problem

2004-05-12 Thread Victoria Reznichenko
Deepak Vishwanathan [EMAIL PROTECTED] wrote: I have a table named t1 with a column x1 which is the primary key for that table. There are some other tables that reference this table t1 on x1 with foreign key constraints. I wanted to rename the column x1 for some reason, so, I went ahead and

Re: Foreign Key

2004-04-16 Thread lga2
I creates 2 tables create table test1(Ser int(5) primary key,age int(2)) type=InnoDB; create table test2(Serno int(5) references test1(Ser),name varchar(20)) type=InnoDB; I inserted a value in test2 and it accepted. Isnt that wrong? shouldnt it accept only if there is a vlue in the first

RE: Foreign Key

2004-04-16 Thread Victor Pendleton
Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 4/16/04 12:26 PM Subject: Re: Foreign Key I creates 2 tables create table test1(Ser int(5) primary key,age int(2)) type=InnoDB; create table test2(Serno int(5) references test1(Ser),name varchar(20)) type=InnoDB; I inserted a value

Re: foreign key constraints are driving me crazy!

2004-03-04 Thread daniel
Some key in the table is null when it shouldnt be, or the type of the join keys isnt the same. i have had issues when importing data from a dump so i've had to do a FORIEGN_KEY_CHECKS=0 So I have made a table called 'uid' where on uid is the only field in the table. Then I make another table

  1   2   3   >