Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [MYSQL] Problemi con una tabella
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
drakend
.grande:maestro.

User info:
Registered: Oct 2002
Posts: 1857 (0.23 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 16:15:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[MYSQL] Problemi con una tabella

Ciao,
provo a creare questa tabella dentro Mysql, ma ricevo un messaggio di errore:

code:
CREATE TABLE Utenti( IdUtente BIGINT( 20 ) UNSIGNED AUTO_INCREMENT , Username CHAR( 250 ) NOT NULL , PASSWORD TEXT NOT NULL , Nome TEXT, Cognome TEXT, Proprietario enum( 'Sì', 'No' ) NOT NULL DEFAULT 'No', Amministratore enum( 'Sì', 'No' ) NOT NULL DEFAULT 'No', IdSocietà BIGINT( 20 ) UNSIGNED NOT NULL , IdSocietà1 BIGINT( 20 ) UNSIGNED, NomeGruppo CHAR( 250 ) , PRIMARY KEY ( IdUtente ) , UNIQUE KEY ( Username ) , INDEX IdSocietàIndex( IdSocietà ) , INDEX IdSocietà1Index( IdSocietà1 ) , INDEX NomeGruppoIndex( NomeGruppo ) , FOREIGN KEY ( IdSocietà ) REFERENCES Società( IdSocietà ) ON DELETE CASCADE ON UPDATE CASCADE , FOREIGN KEY ( IdSocietà1, NomeGruppo ) REFERENCES Gruppi( IdSocietà, NomeGruppo ) ON DELETE CASCADE ON UPDATE CASCADE ) TYPE = INNODB MySQL said: #1005 - Impossibile creare la tabella '.\agenda\utenti.frm' (errno: 150)


Se tolgo le due FOREIGN KEY me la crea senza problemi. Tabelle invece come queste me le crea pure senza messaggi di errore:
code:
CREATE TABLE Società ( IdSocietà BIGINT(20) UNSIGNED AUTO_INCREMENT, RagioneSociale TEXT NOT NULL, ScadenzaContratto DATE NOT NULL, NumeroUtentiComprati INT UNSIGNED NOT NULL, Descrizione TEXT NOT NULL, PRIMARY KEY (IdSocietà), ) TYPE=INNODB; CREATE TABLE Gruppi ( IdSocietà BIGINT(20) UNSIGNED, NomeGruppo CHAR(250), PRIMARY KEY (IdSocietà,NomeGruppo), INDEX IdSocietàIndex (IdSocietà), FOREIGN KEY (IdSocietà) REFERENCES Società(IdSocietà) ON DELETE CASCADE ON UPDATE CASCADE ) TYPE=INNODB;


Da che può dipendere questo problema?

25-07-2005 07:58
Click Here to See the Profile for drakend Click here to Send drakend a Private Message Find more posts by drakend Add drakend to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Flyzone
.coltellino:svizzero.

User info:
Registered: Jan 2003
Posts: 1956 (0.24 al dì)
Location:
Corso:
Anno:
Time Online: 19 Days, 22:20:19 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: [MYSQL] Problemi con una tabella

Originally posted by drakend
Da che può dipendere questo problema?

Integrità referenziale, devi prima creare la tabella Società(con la chiave IdSocietà ) prima delle tabella Utenti.

25-07-2005 08:42
Click Here to See the Profile for Flyzone Click Here to See the Blog of Flyzone Click here to Send Flyzone a Private Message Find more posts by Flyzone Add Flyzone to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
drakend
.grande:maestro.

User info:
Registered: Oct 2002
Posts: 1857 (0.23 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 16:15:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Sì certo... a quello ci avevo già pensato, ma il problema rimane...

25-07-2005 08:54
Click Here to See the Profile for drakend Click here to Send drakend a Private Message Find more posts by drakend Add drakend to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.69 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by drakend
Sì certo... a quello ci avevo già pensato, ma il problema rimane...


Guarda qui magari e' lo stesso problema:

Lick Me

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

25-07-2005 09:25
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
drakend
.grande:maestro.

User info:
Registered: Oct 2002
Posts: 1857 (0.23 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 16:15:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Alf
Guarda qui magari e' lo stesso problema:

Lick Me

Ciao,
il problema non era quello, ma mi ha messo sulla strada giusta. In poche parole dovevo creare un indice inclusivo di TUTTE le chiavi parziali utilizzate in una chiave esterna.
Grazie per l'aiuto! :)

25-07-2005 12:36
Click Here to See the Profile for drakend Click here to Send drakend a Private Message Find more posts by drakend Add drakend to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.69 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by drakend
Ciao,
il problema non era quello, ma mi ha messo sulla strada giusta. In poche parole dovevo creare un indice inclusivo di TUTTE le chiavi parziali utilizzate in una chiave esterna.
Grazie per l'aiuto! :)


Prego
:smokin:

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

25-07-2005 12:47
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 15:54.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.041 seconds (66.39% PHP - 33.61% MySQL) con 27 query.