Création table MySQL

Résolu
Jkai -  
bissdebrazza Messages postés 2886 Statut Contributeur -
Bonjour,
je ne comprends pas pourquoi cette requête plante :
 CREATE TABLE `Personne_Fonct` (
`Seq` INTEGER NOT NULL AUTO_INCREMENT ,
`Code` INTEGER NOT NULL DEFAULT 0,
`Fonction` VARCHAR( 5 ) ,
`N_Etabli` VARCHAR( 5 ) ,
`N_Adherent` VARCHAR( 6 ) ,
`Dcre` DATETIME,
`User_Cre` VARCHAR( 50 ) ,
`Dmaj` DATETIME,
`User_Maj` VARCHAR( 50 ) ,
`Tel_Port` VARCHAR( 20 )
) TYPE = InnoDB

MySQL a répondu:Documentation
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 

Quelqu'un aurait une solution ?

Merci
Configuration: Windows XP
Firefox 3.0.1

4 réponses

  1. basshero816 Messages postés 115 Statut Membre 6
     
    Salut,
    L'erreur est parlante, tu n'as pas attribué de clé primaire à cette table.
    Ajoute un primary key pour le premier champ, et tout ira bien.

    @+
    -1
  2. bissdebrazza Messages postés 2886 Statut Contributeur 712
     
    salut!

    essai ça!!

    CREATE TABLE Personne_Fonct (
    Seq INTEGER NOT NULL AUTO_INCREMENT ,
    Code INTEGER NOT NULL DEFAULT 0,
    Fonction VARCHAR( 5 ) ,
    N_Etabli VARCHAR( 5 ) ,
    N_Adherent VARCHAR( 6 ) ,
    Dcre DATETIME,
    User_Cre VARCHAR( 50 ) ,
    Dmaj DATETIME,
    User_Maj VARCHAR( 50 ) ,
    Tel_Port VARCHAR( 20 )
    ) TYPE = InnoDB

    essai de definir une clé primaire!
    -1
  3. bissdebrazza Messages postés 2886 Statut Contributeur 712
     
    si ça marche,alors n'oubli pas de mettre résolu!!
    -1