|
Related Topics:
| delete where exists ??? - Hi, if i run the following query: select * from sol where * from so, customers c where = and =..
Question about UPDATE and LEFT JOIN - Hi, I hope this is the right place to post, but, I am having a problem with an UPDATE command and a LEFT JOIN, I am using something like: UPDATE table_a LEFT JOIN table_b ON SET WHERE ..
Best way to issue hundreds of inserts/updates??? - Using mysql 4.0.23- What is the best way to execute several (hundreds of) inserts and updates? Rather than issuing tons of inserts and updates, can I send the strings to a text file and then have mysql do them all?? IE : query.txt insert..
MySQL freezes, brings XP machine to a grinding halt - I've been using MySQL for a while for fairly light database on my XP machine. I am just starting a new project and have some big problems with MySQL today both on my office machine and at home where running a
login as user 'root' but do not have root privlages and my.. - Hi gang: I'm a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it doesn't recognize me being logged in as root (via..
|
|
|
Next: newbie JDBC SP exec
|
| Author |
Message |
External

Since: Aug 19, 2003 Posts: 49
|
(Msg. 1) Posted: Mon Mar 15, 2004 3:30 pm
Post subject: Basic Question about DELETE Archived from groups: mailing>database>mysql, others (more info?)
|
|
|
Just a basic question regarding a relational database like MySQL.
I am using a MySQL database wherein tables are, naturally, linked to other
tables via indexes. Say I have tableA and tableB. TableB has a field which
contains a link to tableA.
Each day, operations are performed wherein a third table, tableC, is
created, with a history of the days actions, and thus contains links to the
other tables.
Now, if I delete a record in tableA dont I destroy the integrity of the
database? Or, to a lesser extent, if I destroy a link in tableB also. How
does one maintian the integrity of the database while allowing records to be
deleted? How do you typically do that?
Thanks, Ike >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Sep 10, 2003 Posts: 41
|
(Msg. 2) Posted: Mon Mar 15, 2004 4:51 pm
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Ike" <rxv.TakeThisOut@hotmail.com> wrote in message
news:tlh5c.22162$%06.15611@newsread2.news.pas.earthlink.net...
> Just a basic question regarding a relational database like MySQL.
>
> I am using a MySQL database wherein tables are, naturally, linked to other
> tables via indexes. Say I have tableA and tableB. TableB has a field
which
> contains a link to tableA.
>
> Each day, operations are performed wherein a third table, tableC, is
> created, with a history of the days actions, and thus contains links to
the
> other tables.
>
> Now, if I delete a record in tableA dont I destroy the integrity of the
> database? Or, to a lesser extent, if I destroy a link in tableB also. How
> does one maintian the integrity of the database while allowing records to
be
> deleted? How do you typically do that?
>
> Thanks, Ike
>
>
Three options:
1=set the referring column from all referring rows to NULL before deleting
2=delete all referring rows before deleting
3=do not delete<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Jan 12, 2004 Posts: 11
|
(Msg. 3) Posted: Mon Mar 15, 2004 7:36 pm
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Silvio Bierman wrote:
> Three options:
>
> 1=set the referring column from all referring rows to NULL before deleting
> 2=delete all referring rows before deleting
> 3=do not delete
4=delete with option "on cascade"
A.G.<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Mar 16, 2004 Posts: 3
|
(Msg. 4) Posted: Tue Mar 16, 2004 6:19 am
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Andree Große <user DeleteThis @example.net> wrote ...
> Silvio Bierman wrote:
> > Three options:
> >
> > 1=set the referring column from all referring rows to NULL before deleting
> > 2=delete all referring rows before deleting
> > 3=do not delete
>
> 4=delete with option "on cascade"
Unfortunately, MySQL doesn't yet support cascading deletes, so Ike will
have to follow Silvio's original suggestions.
David Harper
Cambridge, England<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Sep 10, 2003 Posts: 41
|
(Msg. 5) Posted: Tue Mar 16, 2004 1:13 pm
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Andree Große" <user DeleteThis @example.net> wrote in message
news:c34iij$l7t$3@ppd00021.deutschepost.de...
> Silvio Bierman wrote:
> > Three options:
> >
> > 1=set the referring column from all referring rows to NULL before
deleting
> > 2=delete all referring rows before deleting
> > 3=do not delete
>
> 4=delete with option "on cascade"
>
> A.G.
Very non-standard but if available equivalent to 2.
Silvio Bierman<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Mar 16, 2004 Posts: 1
|
(Msg. 6) Posted: Tue Mar 16, 2004 7:25 pm
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <1dfad7c0.0403160319.222b72f8 DeleteThis @posting.google.com>,
devnull DeleteThis @obliquity.u-net.com (David Harper) writes:
> Andree Große <user DeleteThis @example.net> wrote ...
>> Silvio Bierman wrote:
>> > Three options:
>> >
>> > 1=set the referring column from all referring rows to NULL before deleting
>> > 2=delete all referring rows before deleting
>> > 3=do not delete
>>
>> 4=delete with option "on cascade"
> Unfortunately, MySQL doesn't yet support cascading deletes, so Ike will
> have to follow Silvio's original suggestions.
From the fine MySQL manual:
Starting from version 3.23.50, you can also associate the `ON DELETE
CASCADE' or `ON DELETE SET NULL' clause with the foreign key
constraint. Corresponding `ON UPDATE' options are available starting
from 4.0.8. 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 to the
referenced key value in the parent row.<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
External

Since: Jan 25, 2004 Posts: 32
|
(Msg. 7) Posted: Tue Mar 16, 2004 10:26 pm
Post subject: Re: Basic Question about DELETE [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Harald Fuchs wrote:
> In article <1dfad7c0.0403160319.222b72f8.RemoveThis@posting.google.com>,
> devnull.RemoveThis@obliquity.u-net.com (David Harper) writes:
[SNIP]
>>Unfortunately, MySQL doesn't yet support cascading deletes, so Ike will
>>have to follow Silvio's original suggestions.
>
>
> From the fine MySQL manual:
>
> Starting from version 3.23.50, you can also associate the `ON DELETE
> CASCADE' or `ON DELETE SET NULL' clause with the foreign key
> constraint. Corresponding `ON UPDATE' options are available starting
> from 4.0.8. 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 to the
> referenced key value in the parent row.
This is correct for InnoDB tables, but not for MyISAM, which is the
default table type. If Ike's application demands referential integrity,
he should make sure that he is using InnoDB tables.
David Harper
Cambridge, England<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Basic Question about DELETE |
|
| Back to top |
|
 |  |
|