PROBLEM WITH TRANSACTION/ROLLBACK
Posted by:
clandernet
Date: August 31, 2004 11:03AM
Hello and sorry but I don't write english very well.
I'm using MySQL v4.0.18, with WindowsXP. I'm using INNODB tables and REFERENTIAL INTEGRITY.
I have a problem and I donĀ“t know how I can resolve it.
I have two tables.
->First table store CATEGORY OF PAGES.
->Second table store FATHERS OF CATEGORY.
I have got a structure of TREE to store CATEGORIES.
Only one CATEGORY is the root of the TREE.
CREATE TABLE tecnoinfo10_CATPAGINAS
(
IDCatPag int(10) NOT NULL auto_increment,
NameCatPag varchar(50) NOT NULL default '',
PRIMARY KEY (IDCatPag)
) TYPE=InnoDB;
CREATE TABLE tecnoinfo10_CATPAGPADRE
(
IDCatPag int(10) NOT NULL,
IDCatPadre int(10) NOT NULL,
PRIMARY KEY (IDCatPag),
INDEX (IDCatPadre),
FOREIGN KEY (IDCatPag) REFERENCES tecnoinfo10_CATPAGINAS (IDCatPag) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (IDCatPadre) REFERENCES tecnoinfo10_CATPAGINAS (IDCatPag) ON DELETE CASCADE ON UPDATE CASCADE
) TYPE=InnoDB;
mysql> SELECT * FROM tecnoinfo10_catpaginas;
+----------+------------+
| IDCatPag | NameCatPag |
+----------+------------+
| 1 | Inicio |
| 2 | Admin |
| 3 | Config |
| 4 | Idiomas |
| 5 | Bloques |
| 6 | Categorias |
+----------+------------+
6 rows in set (0.01 sec)
mysql> SELECT * FROM tecnoinfo10_catpagpadre
+----------+------------+
| IDCatPag | IDCatPadre |
+----------+------------+
| 2 | 1 |
| 3 | 2 |
| 4 | 2 |
| 5 | 2 |
| 6 | 2 |
+----------+------------+
5 rows in set (0.01 sec)
The TREE's STRUCTURE is it:
1:INICIO
|
|___ 2:ADMIN
|
|___ 3:CONFIG
|
|___ 4:IDIOMAS
|
|___ 5:BLOQUES
|
|___ 6:CATEGORIAS
Continue...
Subject
Written By
Posted
PROBLEM WITH TRANSACTION/ROLLBACK
August 31, 2004 11:03AM
September 01, 2004 03:46AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.