Re: reg: on delete cascade

2008-03-11 Thread Tim McDaniel
reate table orders(OID int, O_Date date, customer_SID int, primary key (OID), Foreign key (customer_SID) references customer (SID) on delete cascade

RE: on delete cascade

2008-03-11 Thread Rolando Edwards
To: mysql@lists.mysql.com Subject: reg: on delete cascade I created two tables like this: create table customer(SID int,name varchar(20),primary key(SID)); create table orders(OID int,O_Date date,customer_SID int,primary key(OID),Foreign key(customer_SID) references customer(SID) on delete cascade

Re: reg: on delete cascade

2008-03-11 Thread Rob Wultsch
er_SID) references customer(SID) on delete > cascade on update cascade); > > And inserted values into it.but when i deleted a row from customer which has > reference in orders it didn't showed any error..it deleted the value in > customer table while it's reference i

reg: on delete cascade

2008-03-11 Thread smriti Sebastian
I created two tables like this: create table customer(SID int,name varchar(20),primary key(SID)); create table orders(OID int,O_Date date,customer_SID int,primary key(OID),Foreign key(customer_SID) references customer(SID) on delete cascade on update cascade); And inserted values into it.but when

Re: ON DELETE CASCADE question

2006-07-17 Thread Rhino
ble. -- Rhino - Original Message - From: "James Sherwood" <[EMAIL PROTECTED]> To: "mysqllist" Sent: Monday, July 17, 2006 8:44 AM Subject: ON DELETE CASCADE question Hello. I have a question about on delete cascade. If i have 2 tables such as this: Tab

ON DELETE CASCADE question

2006-07-17 Thread James Sherwood
Hello. I have a question about on delete cascade. If i have 2 tables such as this: Table1Table2 PrikeyPrikey Table2foreinkey name name description description Now if I delete a row from table1 that has a foreign

Re: Foreign key contraints, on delete cascade not working?

2004-01-16 Thread Andrew DeFaria
Victoria Reznichenko wrote: Andrew DeFaria <[EMAIL PROTECTED]> wrote: Victoria Reznichenko wrote: Andrew DeFaria <[EMAIL PROTECTED]> wrote: As you can see I when I delete from user (the parent table) the useropts (child table) entry remains. Shouldn't it be deleted? Heikki Tuuri asked me to loo

Re: Foreign key contraints, on delete cascade not working?

2004-01-15 Thread Victoria Reznichenko
Andrew DeFaria <[EMAIL PROTECTED]> wrote: > Victoria Reznichenko wrote: > >> Andrew DeFaria <[EMAIL PROTECTED]> wrote: >>> As you can see I when I delete from user (the parent table) the >>> useropts (child table) entry remains. Shouldn't it be deleted? >>> >>> Heikki Tuuri asked me to look at my

Re: Foreign key contraints, on delete cascade not working?

2004-01-13 Thread Andrew DeFaria
Victoria Reznichenko wrote: Andrew DeFaria <[EMAIL PROTECTED]> wrote: I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB automatically d

Re: Foreign key contraints, on delete cascade not working?

2004-01-13 Thread Victoria Reznichenko
Andrew DeFaria <[EMAIL PROTECTED]> wrote: > I created the following .sql file to demonstrate a problem I'm having. > According to the manual: > > If |ON DELETE CASCADE| is specified, and a row in the parent table >is deleted, then InnoDB automatically dele

Foreign key contraints, on delete cascade not working?

2004-01-12 Thread Andrew DeFaria
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If ON DELETE CASCADE is specified, and a row in the parent table is deleted, then InnoDB automatically deletes also all those rows in the child table whose foreign key values are equal t

Re: foreign key contraints, on delete cascade not working?

2004-01-10 Thread Heikki Tuuri
ts ( -> useridvarchar (8)not null, -> nametinytext, -> valuevarchar (128), -> key user_index (userid), -> foreign key (userid) references user (userid) on delete cascade -> ) type=innodb; -- useropts Query OK, 0 rows affe

Re: innodb on delete cascade

2003-08-14 Thread Egor Egorov
---+-----+-++ > 3 rows in set (0.00 sec) > > > mysql>alter table name add foreign key(id) references gene(id) on delete cascade; > > mysql> select * from gene; > ++--+--

Re: innodb on delete cascade

2003-08-14 Thread Jeff Mathis
we're using a slightly different syntax. add the word "constraint" in front of foreign key. alter table name add constraint foreign key(id) references gene(id) on delete cascade; we rely on cascading deletes. This works in our case. good luck. "R.Dobson" wrote: >

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
mmm, i've just tried the example within the mysql docs: CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE cascade ) TYPE=I

innodb on delete cascade

2003-08-14 Thread R.Dobson
char(100) | | | || +-+---+--+-+-++ 3 rows in set (0.00 sec) mysql>alter table name add foreign key(id) references gene(id) on delete cascade; mysql> select * from gene; ++--+-+ | id | name | species | ++--+-+ | 9

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
hild(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE cascade ) TYPE=INNODB; Now, insert a couple of lies of data: mysql> insert into parent values(1); Query OK, 1 row affected (0.00 sec) mysql> insert into p

Re: innodb on delete cascade

2003-08-14 Thread Victoria Reznichenko
"R.Dobson" <[EMAIL PROTECTED]> wrote: > > Hi, i'm using Distrib 4.0.1-alpha, for sun-solaris2.8 (sparc) It's an outdated version and it doesn't support ON DELETE, just parsed. Upgraid MySQL to the recent version (4.0.14) -- For technical support contracts, goto https://order.mysql.com/?ref=e

Re: innodb on delete cascade

2003-08-14 Thread Jeff Mathis
type = InnoDB; alter table Child add index(parent_id); alter table Child add constraint foreign key(parent_id) references Parent(id) on delete cascade; mysql> insert into Parent values(1); Query OK, 1 row affected (0.04 sec) mysql> insert into Parent values(2); Query OK, 1 row affecte

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
|| | species | varchar(100) | | | || +-+---+--+-+-++ 3 rows in set (0.00 sec) mysql>alter table name add foreign key(id) references gene(id) on delete cascade; mysql> select * from gene; ++--+-+ |

Re: innodb on delete cascade

2003-08-14 Thread Victoria Reznichenko
KEY (parent_id) REFERENCES parent(id) > ON DELETE cascade > ) TYPE=INNODB; > > Now, insert a couple of lies of data: > > mysql> insert into parent values(1); > Query OK, 1 row affected (0.00 sec) > > mysql> insert into parent values(2); > Que

Re: innodb on delete cascade

2003-08-12 Thread Jeff Mathis
ey(gene_id) references gene(id) on delete cascade;" In fact, I'm not sure you can actually create the constraint as you currently describe it "R.Dobson" wrote: > > Hi, yes, I should have included in the first mail. They are: >

Re: ON DELETE CASCADE ON UPDATE CASCADE

2003-06-11 Thread Heikki Tuuri
AIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Wednesday, June 11, 2003 9:03 AM Subject: ON DELETE CASCADE ON UPDATE CASCADE > HI I'm not sure whether it's a bug or my configuration problem?? > > I have upgraded mysql from 3.23.53 to 4.0.12 so that the on update > c

ON DELETE CASCADE ON UPDATE CASCADE

2003-06-10 Thread vinita Vigine Murugiah
> CREATE TABLE software_machineOSs ( -> softwareID CHAR(20) NOT NULL, -> osName CHAR(20) NOT NULL, -> osRevision CHAR(20), -> INDEX (softwareID), -> FOREIGN KEY (softwareID) REFERENCES software (softwareID) ON DELETE CASCADE ON U

on delete cascade works for self-referencing row but on update cascade isn't?

2003-06-03 Thread Jindo
) unsigned NOT NULL default '0', `Lft` smallint(5) unsigned NOT NULL default '0', `Rgt` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`ShopId`), KEY `Node` (`Node`), CONSTRAINT `0_2042` FOREIGN KEY (`Node`) REFERENCES `Shops` (`ShopId`) ON DELETE

INNODB still not working Re: Does mysql support foreign key on delete cascade and on update cascade?

2002-12-11 Thread Jing Dai
ERENCES samDB.license_info (licenseID) match full on delete cascade on update cascade, -> logDate DATE NOT NULL, -> totalLic integer(5) NOT NULL, -> requestLic integer(5) NOT NULL, -> issuedLic integer(5) NOT NULL, -> queuedLic integer(5) NOT NULL, -> deniedLi

Re: Does mysql support foreign key on delete cascade and on update cascade?

2002-12-11 Thread Jing Dai
Ok, I found answer, I did need uncomment out my.cnf to support InnoDB type. Also I need to install mysql-max binary as I am running on Unix Platform. jing Jing Dai wrote: > Hi, > Thank you for the reply. > I did what you suggested, but show create table is still MYISM, why? > Do I need to configu

Re: Does mysql support foreign key on delete cascade and on update cascade?

2002-12-11 Thread Jing Dai
Hi, Thank you for the reply. I did what you suggested, but show create table is still MYISM, why? Do I need to configure something in the my.cfn file? mysql> create table samDB.license_info ( -> licenseID integer(5) auto_increment primary key, -> vendorName VARCHAR(30) NOT NULL, -> fe

Re: Does mysql support foreign key on delete cascade and on update cascade?

2002-12-10 Thread Benjamin Pflugmann
Hello. On Tue 2002-12-10 at 16:05:05 -0800, [EMAIL PROTECTED] wrote: > I am just working on mySQL and create two tables, defined licenseID is > the primary key in license_info, and foreign key in license_data. > But I tested it didn't work the way as like in Oracle delete cascade or > update casca

Does mysql support foreign key on delete cascade and on update cascade?

2002-12-10 Thread Jing Dai
license_info (licenseID) match full on delete cascade on update cascade, -> logDate DATE NOT NULL, -> totalLic integer(5) NOT NULL, -> issuedLic integer(5) NOT NULL, -> queuedLic integer(5) NOT NULL, -> deniedLic integer(5) NOT NULL, -> comment VARCHAR(1

Re: How to On DELETE CASCADE

2002-07-04 Thread Egor Egorov
gt; documentation says that foreign keys aren't implemented in MySQL, so how m> to solve this elementary issue ? Foreign keys are implemented in MySQL since 3.23.44b. ON DELETE CASCADE are supported since 3.23.50. But if you want to use foreign key constraints and ON CASCADE DELET

Re: How to On DELETE CASCADE

2002-07-03 Thread Bhavin Vyas
tivac" <[EMAIL PROTECTED]> To: "MySQL" <[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 2:22 PM Subject: How to On DELETE CASCADE > Hello, > > I'm quite new in MySQL and PHP, so I guess my question is stupide. Sorry > for that but I really need the

How to On DELETE CASCADE

2002-07-03 Thread multivac
Hello, I'm quite new in MySQL and PHP, so I guess my question is stupide. Sorry for that but I really need the solution... I have 2 tables table Client : --- |ClientID | ClientName| --- |1| Eric | |2| Mark | |3| Simon

Re: on delete cascade

2002-06-11 Thread Egor Egorov
Pierre, Tuesday, June 11, 2002, 4:51:16 PM, you wrote: PB> does mysql-max 3.23.50 support the option on delete cascade for the PB> foreign key, the documentation is not very clear on this point Yes, since 3.23.50 MySQL supports ON DELETE CASCADE and ON DELETE SET NULL on InnoDB table

RE: on delete cascade

2002-06-11 Thread Jay Blanchard
[snip] does mysql-max 3.23.50 support the option on delete cascade for the foreign key, the documentation is not very clear on this point [/snip] No , it does not. Jay sql, mysql, query - Before posting, please check

on delete cascade

2002-06-11 Thread Pierre Baridon
does mysql-max 3.23.50 support the option on delete cascade for the foreign key, the documentation is not very clear on this point Pierre -- sql,query - Before posting, please check: http://www.mysql.com/manual.php

Re: FOREIGN KEY ... ON DELETE CASCADE

2001-09-11 Thread Dennis Salguero
://www.beridney.com - Original Message - From: "Jeff Tanner" <[EMAIL PROTECTED]> To: "Mysql (E-mail)" <[EMAIL PROTECTED]> Sent: Tuesday, September 11, 2001 9:13 AM Subject: FOREIGN KEY ... ON DELETE CASCADE > Is FOREIGN KEY ... ON DELETE CASCADE operational in m

FOREIGN KEY ... ON DELETE CASCADE

2001-09-11 Thread Jeff Tanner
Is FOREIGN KEY ... ON DELETE CASCADE operational in mysql? If so, I am not observing such. Here is how I am using it: CREATE TABLE scheduled_task_list ( schedule_id CHAR(28) NOT NULL, /* keys */ PRIMARY KEY (schedule_id) ); CREATE TABLE