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

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 specifi

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 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 on multiple columns

2013-03-21 Thread Abhishek Choudhary
sage - From: Peter Brawley 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 tri

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

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 f

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

Re: Foreign key and uppercase / lowercase values

2012-06-18 Thread GF
Sent: Friday, 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

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

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. However,

RE: Foreign key and uppercase / lowercase values

2012-06-15 Thread Rick James
acle.com] > Sent: 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 creat

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 a

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

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-13 Thread Rick James
m > Subject: Re: 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_con

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 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, GF wrote: Good morning, I have an ap

RE: Foreign key and uppercase / lowercase values

2012-05-16 Thread Rick James
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

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 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 applicative logic, in

Re: Foreign Key Error

2011-02-14 Thread Victor Subervi
Thank you! V On Mon, Feb 14, 2011 at 9:08 PM, Gavin Towey 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: Vi

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 P

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 co

Re: Foreign Key Problem

2010-06-22 Thread Victor Subervi
On Tue, Jun 22, 2010 at 11:53 AM, jayabharath 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 > error. > Than

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

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-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), forei

Re: Foreign Key Problem

2010-05-20 Thread Victor Subervi
On Wed, May 19, 2010 at 12:02 PM, Shawn Green wrote: > Victor Subervi wrote: > >> On Wed, May 19, 2010 at 10:59 AM, Shawn Green > >wrote: >> >> Shawn Green wrote: >> >> > look again closely at your FK definitions. The pattern should be >>> >> > FOREIGN KEY (child_table_column) REFERENCES > paren

Re: Foreign Key Problem

2010-05-19 Thread Shawn Green
Victor Subervi wrote: On Wed, May 19, 2010 at 10:59 AM, Shawn Green wrote: 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 table (t

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Wed, May 19, 2010 at 10:59 AM, Shawn Green wrote: > 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 table (the child table)

Re: Foreign Key Problem

2010-05-19 Thread Shawn Green
Victor Subervi wrote: On Tue, May 18, 2010 at 2:23 PM, Shawn Green wrote: 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? http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-k

Re: Foreign Key Problem

2010-05-19 Thread Victor Subervi
On Tue, May 18, 2010 at 2:23 PM, Shawn Green wrote: > 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? > > http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.h

Re: Foreign Key Problem

2010-05-18 Thread Shawn Green
Victor Subervi wrote: On Tue, May 18, 2010 at 1:09 PM, Shawn Green > 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: 100518 10:26:22 Error i

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
On Tue, May 18, 2010 at 1:09 PM, Shawn Green 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: 100518 10:26:22 Error in foreign key constraint of table seaflight/Passengers: constrain

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 wrote: 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 Johan De Meersman
On Tue, May 18, 2010 at 6:00 PM, Victor Subervi wrote: > > > 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 only ones) first -

Re: Foreign Key Problem

2010-05-18 Thread Victor Subervi
On Tue, May 18, 2010 at 10:06 AM, Johan De Meersman wrote: > 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 ? Got me. No, it was

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 wrote: > Hi; > mysql> create table i

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 > Sorry all, I was being a dummy! Missed the unsigned attribute off th

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'

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

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: http://

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

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`) referencesdeck(`i

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 ap

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

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

Re: Foreign Key with constant?

2005-12-27 Thread Jesse
t;; Sent: Tuesday, 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 C

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 ref

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 f

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 CON

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 re

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 support

Re: Foreign key support in MyISAM

2005-09-28 Thread Josh Trutwin
On Wed, 28 Sep 2005 04:24:08 -0700 Sujay Koduri <[EMAIL PROTECTED]> wrote: > does anyone have an idea when mysql guys are going to include foreign key > support in myisam tables. > i have read that it is slated for a future release, but it is not mentioned > when it is actually scheduled for. >

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 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 only-one-pa

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

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

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 o

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

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 tu

Re: foreign key design stratgies

2005-04-11 Thread Rhino
- Original Message - From: "Steve Lefevre" <[EMAIL PROTECTED]> To: 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 manual: > > [ON DEL

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 M

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 foreig

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 tim

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

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

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

2004-11-03 Thread Martijn Tonies
> Hi all, I whould like to know if there is a > way to create Foreign Key╢s 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: http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constra

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 PROTECT

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 TABL

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 c

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

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

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

Re: Foreign Key Constraints

2004-05-28 Thread Martijn Tonies
Hi, > > Martijn Tonies wrote: > > > >> Hi Jeff, > >> > > > > > > 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 Mich

Re: Foreign Key Constraints

2004-05-28 Thread Michael Stassen
Michael Stassen wrote: Martijn Tonies wrote: Hi Jeff, 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 what you

Re: Foreign Key Constraints

2004-05-28 Thread Michael Stassen
Martijn Tonies wrote: Hi Jeff, 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) ) TYPE=I

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 have

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

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

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 nul

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_

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 ;-) Shaw

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

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

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 not

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

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

RE: Foreign Key

2004-04-16 Thread Victor Pendleton
--Original 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 insert

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 table

  1   2   3   >