IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PowerAMC Discussion :

BD MYSQL MERISE


Sujet :

PowerAMC

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2011
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2011
    Messages : 3
    Points : 3
    Points
    3
    Par défaut BD MYSQL MERISE
    Bonjour,
    Je n'arrive pas à générer ma base de données.
    Aidez-moi, svp ; je n'arrive pas à corriger l'erreur ! Ça fait 2 jours que je suis dessus mais en vain !!!

    Voilà mon MCD:

    le script genéré :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    /*==============================================================*/
    /* Nom de SGBD :  Sybase SQL Anywhere 11                        */
    /* Date de création :  23/08/2011 15:47:30                      */
    /*==============================================================*/
    
    
    if exists(select 1 from sys.sysforeignkey where role='FK_EMPLOYE_APPARTIEN_CAPABILI') then
        alter table EMPLOYE
           delete foreign key FK_EMPLOYE_APPARTIEN_CAPABILI
    end if;
    
    if exists(select 1 from sys.sysforeignkey where role='FK_POINTAGE_EFFECTUE_EMPLOYE') then
        alter table POINTAGE
           delete foreign key FK_POINTAGE_EFFECTUE_EMPLOYE
    end if;
    
    if exists(
       select 1 from sys.sysindex i, sys.systable t
       where i.table_id=t.table_id 
         and i.index_name='CAPABILITY_PK'
         and t.table_name='CAPABILITY'
    ) then
       drop index "CAPABILITY".CAPABILITY_PK
    end if;
    
    if exists(
       select 1 from sys.systable 
       where table_name='CAPABILITY'
         and table_type in ('BASE', 'GBL TEMP')
    ) then
        drop table "CAPABILITY"
    end if;
    
    if exists(
       select 1 from sys.sysindex i, sys.systable t
       where i.table_id=t.table_id 
         and i.index_name='APPARTIENT_FK'
         and t.table_name='EMPLOYE'
    ) then
       drop index EMPLOYE.APPARTIENT_FK
    end if;
    
    if exists(
       select 1 from sys.sysindex i, sys.systable t
       where i.table_id=t.table_id 
         and i.index_name='EMPLOYE_PK'
         and t.table_name='EMPLOYE'
    ) then
       drop index EMPLOYE.EMPLOYE_PK
    end if;
    
    if exists(
       select 1 from sys.systable 
       where table_name='EMPLOYE'
         and table_type in ('BASE', 'GBL TEMP')
    ) then
        drop table EMPLOYE
    end if;
    
    if exists(
       select 1 from sys.sysindex i, sys.systable t
       where i.table_id=t.table_id 
         and i.index_name='EFFECTUE_FK'
         and t.table_name='POINTAGE'
    ) then
       drop index POINTAGE.EFFECTUE_FK
    end if;
    
    if exists(
       select 1 from sys.sysindex i, sys.systable t
       where i.table_id=t.table_id 
         and i.index_name='POINTAGE_PK'
         and t.table_name='POINTAGE'
    ) then
       drop index POINTAGE.POINTAGE_PK
    end if;
    
    if exists(
       select 1 from sys.systable 
       where table_name='POINTAGE'
         and table_type in ('BASE', 'GBL TEMP')
    ) then
        drop table POINTAGE
    end if;
    
    /*==============================================================*/
    /* Table : "CAPABILITY"                                         */
    /*==============================================================*/
    create table "CAPABILITY" 
    (
       ID_CAP               integer                        not null,
       NOM_CAP              long varchar                   null,
       MANAGER              long varchar                   null,
       constraint PK_CAPABILITY primary key (ID_CAP)
    );
    
    /*==============================================================*/
    /* Index : CAPABILITY_PK                                        */
    /*==============================================================*/
    create unique index CAPABILITY_PK on "CAPABILITY" (
    ID_CAP ASC
    );
    
    /*==============================================================*/
    /* Table : EMPLOYE                                              */
    /*==============================================================*/
    create table EMPLOYE 
    (
       ID_EMP               integer                        not null,
       ID_CAP               integer                        not null,
       NOM                  long varchar                   null,
       PRENOM               long varchar                   null,
       TYPE_TRAVAIL         long varchar                   null,
       constraint PK_EMPLOYE primary key (ID_EMP)
    );
    
    /*==============================================================*/
    /* Index : EMPLOYE_PK                                           */
    /*==============================================================*/
    create unique index EMPLOYE_PK on EMPLOYE (
    ID_EMP ASC
    );
    
    /*==============================================================*/
    /* Index : APPARTIENT_FK                                        */
    /*==============================================================*/
    create index APPARTIENT_FK on EMPLOYE (
    ID_CAP ASC
    );
    
    /*==============================================================*/
    /* Table : POINTAGE                                             */
    /*==============================================================*/
    create table POINTAGE 
    (
       ID_P                 integer                        not null,
       ID_EMP               integer                        not null,
       TYPE                 smallint                       null,
       "DATE"               date                           null,
       HEURE                time                           null,
       constraint PK_POINTAGE primary key (ID_P)
    );
    
    /*==============================================================*/
    /* Index : POINTAGE_PK                                          */
    /*==============================================================*/
    create unique index POINTAGE_PK on POINTAGE (
    ID_P ASC
    );
    
    /*==============================================================*/
    /* Index : EFFECTUE_FK                                          */
    /*==============================================================*/
    create index EFFECTUE_FK on POINTAGE (
    ID_EMP ASC
    );
    
    alter table EMPLOYE
       add constraint FK_EMPLOYE_APPARTIEN_CAPABILI foreign key (ID_CAP)
          references "CAPABILITY" (ID_CAP)
          on update restrict
          on delete cascade;
    
    alter table POINTAGE
       add constraint FK_POINTAGE_EFFECTUE_EMPLOYE foreign key (ID_EMP)
          references EMPLOYE (ID_EMP)
          on update restrict
          on delete cascade;
    
    et voilà l'erreur que j'ai:Erreur
    [B]Requête SQL:  
    
    /*==============================================================*//* Nom de SGBD : Sybase SQL Anywhere 11 *//* Date de création : 23/08/2011 15:47:30 *//*==============================================================*/ IF EXISTS (
    
    SELECT 1 
    FROM sys.sysforeignkey
    WHERE role = 'FK_EMPLOYE_APPARTIEN_CAPABILI'
    )
    THEN 
    ALTER TABLE EMPLOYE DELETE FOREIGN KEY FK_EMPLOYE_APPARTIEN_CAPABILI END IF ;


    MySQL a répondu:

    #1064 - Erreur de syntaxe près de 'if exists(select 1 from sys.sysforeignkey where role='FK_EMPLOYE_APPARTIEN_CAPAB' à la ligne 7

  2. #2
    Membre expérimenté Avatar de Yanika_bzh
    Homme Profil pro
    Responsable Applicatif et R&D
    Inscrit en
    Février 2006
    Messages
    1 144
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Responsable Applicatif et R&D
    Secteur : Finance

    Informations forums :
    Inscription : Février 2006
    Messages : 1 144
    Points : 1 738
    Points
    1 738
    Par défaut
    du TSQL sous Mysql ?

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2011
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2011
    Messages : 3
    Points : 3
    Points
    3
    Par défaut
    Citation Envoyé par Yanika_bzh Voir le message
    du TSQL sous Mysql ?
    Je génère mon script pour ma base de données grâce à PowerAMC et j'essaye de l'importer sur phpmyadmin.
    Je l'avais déjà fait par le passé et ça avait fonctionné.
    J'ai un peu oublié les étapes que j'avais suivies
    J'ai oublié quelque chose ?

  4. #4
    Modérateur

    Avatar de CinePhil
    Homme Profil pro
    Ingénieur d'études en informatique
    Inscrit en
    Août 2006
    Messages
    16 801
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur d'études en informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2006
    Messages : 16 801
    Points : 34 063
    Points
    34 063
    Billets dans le blog
    14
    Par défaut
    N'y a t-il pas, dans Power AMC, une option à cocher quelque part pour préciser que le code doit être généré pour MYSQL ?

Discussions similaires

  1. [Kylix] Kylix attaque Mysql ?
    Par nahmsath dans le forum EDI
    Réponses: 9
    Dernier message: 12/08/2002, 19h37
  2. [Kylix] [cgi] pb déploiement appli avec connexion MySQL [rés
    Par Nepomiachty Olivier dans le forum EDI
    Réponses: 3
    Dernier message: 06/08/2002, 20h09
  3. Probleme C++Builder et Mysql
    Par noname dans le forum C++Builder
    Réponses: 3
    Dernier message: 20/06/2002, 13h40
  4. connection a une BDD MySql
    Par delire8 dans le forum MFC
    Réponses: 7
    Dernier message: 19/06/2002, 18h18
  5. [Kylix] Pb connection à Mysql
    Par Anonymous dans le forum EDI
    Réponses: 3
    Dernier message: 25/04/2002, 15h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo