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

SQL Procédural MySQL Discussion :

Procédure stockée avec curseur qui ramène une seule ligne [MySQL-5.7]


Sujet :

SQL Procédural MySQL

  1. #1
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut Procédure stockée avec curseur qui ramène une seule ligne
    Bonjour à tous.

    Voici le code de ma procédure stockée qui me ramène seulement une seule ligne au lieu d'en ramener 3, en effet j'a trop articles dans ma table , en effet j'ai comme l'impression que les résultats sont écrasés au fur et a mesure, c'est seulement la dernier ligne qui est affiché.
    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
     
    DELIMITER $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `INVENTAIRES`(
    IN _Exercice VARCHAR(255),
    OUT _madate VARCHAR(255) ,
    OUT _maref VARCHAR(255),
    OUT _lelibelle VARCHAR(255),
    OUT _LeTotalEntre INT,
    OUT _LeTotalSortie INT,
    OUT   _LeTotalPartenaire INT,
    OUT _Qtedisponible INT
    )
        NO SQL
        DETERMINISTIC
    BEGIN
    DECLARE _codearticle INT;
    DECLARE _fin   INTEGER  DEFAULT 1;
     
    /* delaration du curseur*/
    DECLARE _curs CURSOR 
    FOR SELECT ast_article.id
    FROM ast_article;
     
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
     
    OPEN  _curs;
    FETCH _curs INTO _codearticle;
     
    WHILE (_fin)
    DO
    /* Recherche des autres éléments de la table article*/
    SELECT ast_article.reference_article,ast_article.designation_artcicle
    INTO _maref,_lelibelle
    FROM ast_article
    WHERE ast_article.id  = ._codearticle;
     
     /*Recherche de quantite total en entree*/
    SELECT sum(ligne_tstock.qte_transfert) 
    INTO _LeTotalEntre
    FROM ligne_tstock
    INNER JOIN transfert_stock ON transfert_stock.id=ligne_tstock.id_transfertstock
    WHERE ligne_tstock.code_article = _codearticle AND 
    transfert_stock.exercice= _Exercice AND
    transfert_stock.type_mouvement='ENTREE';
     
    if (_LeTotalEntre IS NULL) then 
     set _LeTotalEntre = 0 ;
     end if ;
     
    /*Recherche de quantite total en sortie*/ 
    SELECT sum(ligne_tstock.qte_transfert) 
    INTO _LeTotalSortie
    FROM ligne_tstock
    INNER JOIN transfert_stock ON transfert_stock.id=ligne_tstock.id_transfertstock
    WHERE ligne_tstock.code_article = _codearticle AND 
    transfert_stock.exercice= _Exercice AND
    transfert_stock.type_mouvement='SORTIE';
     
     
     if (_LeTotalSortie IS NULL) then 
     set _LeTotalSortie = 0 ;
     end if ;
     
    /*Recherche de quantite total envoyée aux service ou au partenaire*/ 
    SELECT sum(ligne_tpartenaire.qte_transfert) 
    INTO _LeTotalPartenaire
    FROM ligne_tpartenaire
    INNER JOIN transfert_partenaire ON transfert_partenaire.id=ligne_tpartenaire.id_transfertpartenaire
    WHERE ligne_tpartenaire.code_article = _codearticle AND 
    transfert_partenaire.exercice= _Exercice;
     
     if (_LeTotalPartenaire IS NULL) then 
     set _LeTotalPartenaire = 0 ;
     end if ;
     
     /* Recherche de la quantite restante*/
    SET _Qtedisponible = _LeTotalEntre - (_LeTotalSortie + _LeTotalPartenaire);
     
     
     if (_Qtedisponible IS NULL) then 
     set _Qtedisponible = 0 ;
     end if ;
     
    FETCH _curs INTO _codearticle;
    END WHILE;
     
    CLOSE _curs;
    END$$
    DELIMITER ;
    J'ai besoin d'aiguillage, pour faire une boucle qui va me ramener les informations sur les 3 articles.

    Merci a tous

  2. #2
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    je viens de réduire mon code pour afficher la liste des articles :
    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
    DELIMITER $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `Test`(IN `_Exercice` VARCHAR(255), OUT `_madate` VARCHAR(255), OUT `_maref` VARCHAR(255), OUT `_lelibelle` VARCHAR(255), OUT `_LeTotalEntre` INT, OUT `_LeTotalSortie` INT, OUT `_LeTotalPartenaire` INT, OUT `_Qtedisponible` INT)
        NO SQL
        DETERMINISTIC
    BEGIN
    DECLARE _codearticle INT;
    DECLARE _fin   INTEGER  DEFAULT 1;
    
    DECLARE _curs CURSOR 
    FOR SELECT ast_article.id
    FROM ast_article;
    
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
    
    OPEN  _curs;
    FETCH _curs INTO _codearticle;
     
    WHILE (_fin)
    DO
    /* Recherche des autres elements de l'articles*/
    SELECT ast_article.reference_article,ast_article.designation_artcicle
    INTO _maref,_lelibelle
    FROM ast_article
    WHERE ast_article.id  = _codearticle;
    FETCH _curs INTO _codearticle;
    
    END WHILE;
    
    END$$
    DELIMITER ;
    La je me rend compte que seul le dernier article est affiché ?
    Je n'ai pas l'ensemble de mes articles, hors j'ai bien mon curseur qui parcours l'ensemble de la table ast_article ?
    je continu de chercher !

  3. #3
    Modérateur
    Avatar de escartefigue
    Homme Profil pro
    bourreau
    Inscrit en
    Mars 2010
    Messages
    10 311
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : bourreau
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2010
    Messages : 10 311
    Points : 39 677
    Points
    39 677
    Billets dans le blog
    9
    Par défaut
    Bonjour

    Vous déclarez un curseur, mais vous faites ensuite une lecture directe par SELECT de la table article...

    Par ailleurs, vous gagnerez grandement en performance en déclarant un curseur qui récupère toutes les informations requise en ajoutant une jointure avec la table des sorties et celles des entrées.
    Comme ça, une seule requête permettra de récupérer tout ce dont vous avez besoin : code article, désignation, cumul des entrées, cumul des sorties...

  4. #4
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    Bonjour,
    Juste pour tester j'ai modifier ma requête en supprimant l'accès a la table article juste après le curseur, mais j'ai toujours le même résultât, c'est a dire que seul une ligne de resultat est affiché :
    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
     
    DELIMITER $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `Inventaire`(IN `_Exercice` VARCHAR(255), OUT `_madate` VARCHAR(255), OUT `_maref` VARCHAR(255), OUT `_lelibelle` VARCHAR(255), OUT `_LeTotalEntre` INT, OUT `_LeTotalSortie` INT, OUT `_LeTotalPartenaire` INT, OUT `_Qtedisponible` INT)
        NO SQL
        DETERMINISTIC
    BEGIN
    DECLARE _codearticle INT;
    DECLARE _fin   INTEGER  DEFAULT 1;
     
    DECLARE _curs CURSOR 
    FOR SELECT ast_article.id
    FROM ast_article;
     
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
     
    OPEN  _curs;
    FETCH _curs INTO _codearticle;
     
    WHILE (_fin)
    DO
     /*Recherche de quantite total en entree*/
    SELECT sum(ligne_tstock.qte_transfert) 
    INTO _LeTotalEntre
    FROM ligne_tstock
    INNER JOIN transfert_stock ON transfert_stock.id=ligne_tstock.id_transfertstock
    WHERE ligne_tstock.code_article = _codearticle AND 
    transfert_stock.exercice= _Exercice AND
    transfert_stock.type_mouvement='ENTREE';
     
    if (_LeTotalEntre IS NULL) then 
     set _LeTotalEntre = 0 ;
     end if ;
     
    /*Recherche de quantite total en sortie*/ 
    SELECT sum(ligne_tstock.qte_transfert) 
    INTO _LeTotalSortie
    FROM ligne_tstock
    INNER JOIN transfert_stock ON transfert_stock.id=ligne_tstock.id_transfertstock
    WHERE ligne_tstock.code_article = _codearticle AND 
    transfert_stock.exercice= _Exercice AND
    transfert_stock.type_mouvement='SORTIE';
     
     
     if (_LeTotalSortie IS NULL) then 
     set _LeTotalSortie = 0 ;
     end if ;
     
    /*Recherche de quantite total envoyée aux service ou au partenaire*/ 
    SELECT sum(ligne_tpartenaire.qte_transfert) 
    INTO _LeTotalPartenaire
    FROM ligne_tpartenaire
    INNER JOIN transfert_partenaire ON transfert_partenaire.id=ligne_tpartenaire.id_transfertpartenaire
    WHERE ligne_tpartenaire.code_article = _codearticle AND 
    transfert_partenaire.exercice= _Exercice;
     
     if (_LeTotalPartenaire IS NULL) then 
     set _LeTotalPartenaire = 0 ;
     end if ;
     
     /* Recherche de la quantite restante*/
    SET _Qtedisponible = _LeTotalEntre - (_LeTotalSortie + _LeTotalPartenaire);
     
     
     if (_Qtedisponible IS NULL) then 
     set _Qtedisponible = 0 ;
     end if ;
     
    FETCH _curs INTO _codearticle;
     
    END WHILE;
     
    CLOSE _curs;
     
    END$$
    DELIMITER ;
    Je vois plus qu'es qu'il faut faire ? j'ai comme l'impression qu'il n'y pas de boucle a la sortie, donc les valeurs sont écrasées !

  5. #5
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    pour chercher a comprendre j'ai été plus drastique en réduisant mon code à ceci :
    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
     
    DELIMITER $$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `Inventaire200`(IN `_Exercice` VARCHAR(255), OUT `_LeTotalEntre` INT)
        NO SQL
        DETERMINISTIC
    BEGIN
    DECLARE _resultat INT;
    DECLARE _codearticle INT;
    DECLARE _fin   INTEGER  DEFAULT 1;
     
    DECLARE _curs CURSOR 
    FOR SELECT ast_article.id
    FROM ast_article;
     
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
     
    OPEN  _curs;
    FETCH _curs INTO _codearticle;
     
    WHILE (_fin)
    DO
     /*Recherche de quantite total en entree*/
    SELECT sum(ligne_tstock.qte_transfert) 
    INTO _LeTotalEntre
    FROM ligne_tstock
    INNER JOIN transfert_stock ON transfert_stock.id=ligne_tstock.id_transfertstock
    WHERE ligne_tstock.code_article = _codearticle AND 
    transfert_stock.exercice= _Exercice AND
    transfert_stock.type_mouvement='ENTREE';
     
    FETCH _curs INTO _codearticle;
     
    END WHILE;
     
    CLOSE _curs;
    END$$
    DELIMITER ;
    Toujours une seule ligne de résultat, hors ma table ast_article a bien 3 articles ?

  6. #6
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    Citation Envoyé par escartefigue Voir le message
    Par ailleurs, vous gagnerez grandement en performance en déclarant un curseur qui récupère toutes les informations requise en ajoutant une jointure avec la table des sorties et celles des entrées.
    Comme ça, une seule requête permettra de récupérer tout ce dont vous avez besoin : code article, désignation, cumul des entrées, cumul des sorties...
    Pouvez vous m'aiguillez ?
    Merci

  7. #7
    Expert éminent sénior Avatar de Artemus24
    Homme Profil pro
    Agent secret au service du président Ulysses S. Grant !
    Inscrit en
    Février 2011
    Messages
    6 452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Agent secret au service du président Ulysses S. Grant !
    Secteur : Finance

    Informations forums :
    Inscription : Février 2011
    Messages : 6 452
    Points : 19 399
    Points
    19 399
    Par défaut
    Salut à tous.

    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
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    --------------
    START TRANSACTION
    --------------
     
    --------------
    set session collation_connection = "latin1_general_ci"
    --------------
     
    --------------
    DROP DATABASE IF EXISTS `base`
    --------------
     
    --------------
    CREATE DATABASE IF NOT EXISTS `base`
            DEFAULT CHARACTER SET `latin1`
            DEFAULT COLLATE       `latin1_general_cs`
    --------------
     
    --------------
    DROP TABLE IF EXISTS `ast_article`
    --------------
     
    --------------
    CREATE TABLE `ast_article`
    ( `id`           integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `reference`    varchar(255)     NOT NULL,
      `designation`  varchar(255)     NOT NULL
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ast_article` (`id`,`reference`,`designation`) values
      (25, 'article 25', 'cuillère'),
      (37, 'article 37', 'fourchette'),
      (42, 'article 42', 'couteau'),
      (53, 'article 53', 'assiette')
    --------------
     
    --------------
    select * from `ast_article`
    --------------
     
    +----+------------+-------------+
    | id | reference  | designation |
    +----+------------+-------------+
    | 25 | article 25 | cuillère    |
    | 37 | article 37 | fourchette  |
    | 42 | article 42 | couteau     |
    | 53 | article 53 | assiette    |
    +----+------------+-------------+
    --------------
    DROP TABLE IF EXISTS `ligne_tstock`
    --------------
     
    --------------
    CREATE TABLE `ligne_tstock`
    ( `id`             integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `code_article`   integer unsigned NOT NULL,
      `exercice`       integer unsigned NOT NULL,
      `mouvement`      varchar(255)     NOT NULL,
      `qte_transfert`  decimal(15,0)    NOT NULL,
      unique index `idx` (`code_article`,`exercice`,`mouvement`)
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ligne_tstock` (`code_article`,`exercice`,`mouvement`,`qte_transfert`) values
      (25,2020,'entree',25),(25,2020,'sortie',17),
      (25,2021,'entree',74),(25,2021,'sortie',12),
      (25,2022,'entree',34),(25,2022,'sortie',45),
     
      (37,2020,'entree',55),(37,2020,'sortie',47),
      (37,2021,'entree',68),(37,2021,'sortie',05),
      (37,2022,'entree',21),(37,2022,'sortie',17),
     
      (42,2020,'entree',74),(42,2020,'sortie',44),
      (42,2021,'entree',47),(42,2021,'sortie',25),
      (42,2022,'entree',26),(42,2022,'sortie',07),
     
      (53,2020,'entree',98),(53,2020,'sortie',55),
      (53,2021,'entree',44),(53,2021,'sortie',22),
      (53,2022,'entree',02),(53,2022,'sortie',12)
    --------------
     
    --------------
    select * from `ligne_tstock`
    --------------
     
    +----+--------------+----------+-----------+---------------+
    | id | code_article | exercice | mouvement | qte_transfert |
    +----+--------------+----------+-----------+---------------+
    |  1 |           25 |     2020 | entree    |            25 |
    |  2 |           25 |     2020 | sortie    |            17 |
    |  3 |           25 |     2021 | entree    |            74 |
    |  4 |           25 |     2021 | sortie    |            12 |
    |  5 |           25 |     2022 | entree    |            34 |
    |  6 |           25 |     2022 | sortie    |            45 |
    |  7 |           37 |     2020 | entree    |            55 |
    |  8 |           37 |     2020 | sortie    |            47 |
    |  9 |           37 |     2021 | entree    |            68 |
    | 10 |           37 |     2021 | sortie    |             5 |
    | 11 |           37 |     2022 | entree    |            21 |
    | 12 |           37 |     2022 | sortie    |            17 |
    | 13 |           42 |     2020 | entree    |            74 |
    | 14 |           42 |     2020 | sortie    |            44 |
    | 15 |           42 |     2021 | entree    |            47 |
    | 16 |           42 |     2021 | sortie    |            25 |
    | 17 |           42 |     2022 | entree    |            26 |
    | 18 |           42 |     2022 | sortie    |             7 |
    | 19 |           53 |     2020 | entree    |            98 |
    | 20 |           53 |     2020 | sortie    |            55 |
    | 21 |           53 |     2021 | entree    |            44 |
    | 22 |           53 |     2021 | sortie    |            22 |
    | 23 |           53 |     2022 | entree    |             2 |
    | 24 |           53 |     2022 | sortie    |            12 |
    +----+--------------+----------+-----------+---------------+
    --------------
    DROP TABLE IF EXISTS `ligne_tpartenaire`
    --------------
     
    --------------
    CREATE TABLE `ligne_tpartenaire`
    ( `id`             integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `code_article`   integer unsigned NOT NULL,
      `exercice`       integer unsigned NOT NULL,
      `mouvement`      varchar(255)     NOT NULL,
      `qte_transfert`  decimal(15,0)    NOT NULL,
      unique index `idx` (`code_article`,`exercice`,`mouvement`)
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ligne_tpartenaire` (`code_article`,`exercice`,`mouvement`,`qte_transfert`) values
      (25,2020,'entree',55),(25,2020,'sortie',47),
      (25,2021,'entree',68),(25,2021,'sortie',05),
      (25,2022,'entree',21),(25,2022,'sortie',17),
     
      (37,2020,'entree',74),(37,2020,'sortie',44),
      (37,2021,'entree',47),(37,2021,'sortie',25),
      (37,2022,'entree',26),(37,2022,'sortie',07),
     
      (42,2020,'entree',98),(42,2020,'sortie',55),
      (42,2021,'entree',44),(42,2021,'sortie',22),
      (42,2022,'entree',02),(42,2022,'sortie',12),
     
      (53,2020,'entree',25),(53,2020,'sortie',17),
      (53,2021,'entree',74),(53,2021,'sortie',12),
      (53,2022,'entree',34),(53,2022,'sortie',45)
    --------------
     
    --------------
    select * from `ligne_tpartenaire`
    --------------
     
    +----+--------------+----------+-----------+---------------+
    | id | code_article | exercice | mouvement | qte_transfert |
    +----+--------------+----------+-----------+---------------+
    |  1 |           25 |     2020 | entree    |            55 |
    |  2 |           25 |     2020 | sortie    |            47 |
    |  3 |           25 |     2021 | entree    |            68 |
    |  4 |           25 |     2021 | sortie    |             5 |
    |  5 |           25 |     2022 | entree    |            21 |
    |  6 |           25 |     2022 | sortie    |            17 |
    |  7 |           37 |     2020 | entree    |            74 |
    |  8 |           37 |     2020 | sortie    |            44 |
    |  9 |           37 |     2021 | entree    |            47 |
    | 10 |           37 |     2021 | sortie    |            25 |
    | 11 |           37 |     2022 | entree    |            26 |
    | 12 |           37 |     2022 | sortie    |             7 |
    | 13 |           42 |     2020 | entree    |            98 |
    | 14 |           42 |     2020 | sortie    |            55 |
    | 15 |           42 |     2021 | entree    |            44 |
    | 16 |           42 |     2021 | sortie    |            22 |
    | 17 |           42 |     2022 | entree    |             2 |
    | 18 |           42 |     2022 | sortie    |            12 |
    | 19 |           53 |     2020 | entree    |            25 |
    | 20 |           53 |     2020 | sortie    |            17 |
    | 21 |           53 |     2021 | entree    |            74 |
    | 22 |           53 |     2021 | sortie    |            12 |
    | 23 |           53 |     2022 | entree    |            34 |
    | 24 |           53 |     2022 | sortie    |            45 |
    +----+--------------+----------+-----------+---------------+
    --------------
    DROP PROCEDURE IF EXISTS `inventaire`
    --------------
     
    --------------
    CREATE PROCEDURE `inventaire` ( In  _exercice integer unsigned,
                                    Out _cumul    integer unsigned)
    DETERMINISTIC
    NO SQL
    BEGIN
      DECLARE _codart  INTEGER UNSIGNED  DEFAULT 0;
      DECLARE _refere  VARCHAR(255)      DEFAULT NULL;
      DECLARE _design  VARCHAR(255)      DEFAULT NULL;
      DECLARE _stock   DECIMAL(15,0)     DEFAULT 0;
      DECLARE _part    DECIMAL(15,0)     DEFAULT 0;
      DECLARE _fin     INTEGER UNSIGNED  DEFAULT 1;
     
      DECLARE _tab     CURSOR FOR SELECT id, reference, designation FROM `ast_article`;
      DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
     
      SET _cumul = 0;
     
      OPEN  _tab;
      FETCH _tab INTO _codart, _refere, _design;
     
      WHILE (_fin)
      DO
        SELECT sum(case when mouvement = 'entree' then +coalesce(qte_transfert,0)
                        when mouvement = 'sortie' then -coalesce(qte_transfert,0)
                        else 0 end)
          INTO _stock
          FROM ligne_tstock
         WHERE code_article = _codart
           AND exercice     = _exercice;
     
        SELECT sum(case when mouvement = 'entree' then +coalesce(qte_transfert,0)
                        when mouvement = 'sortie' then -coalesce(qte_transfert,0)
                        else 0 end)
          INTO _part
          FROM ligne_tpartenaire
         WHERE code_article = _codart
           AND exercice     = _exercice;
     
        select _codart        as article,
               _refere        as reference,
               _design        as designation,
               _stock         as stock,
               _part          as partenaire,
               _stock + _part as total;
     
        SET _cumul = _cumul + _stock + _part;
     
        FETCH _tab INTO _codart, _refere, _design;
      END WHILE;
     
      SELECT _cumul as cumul;
     
      CLOSE _tab;
    END
    --------------
     
    --------------
    set @total = 0
    --------------
     
    --------------
    call `inventaire` (2020, @total)
    --------------
     
    +---------+------------+-------------+-------+------------+-------+
    | article | reference  | designation | stock | partenaire | total |
    +---------+------------+-------------+-------+------------+-------+
    |      25 | article 25 | cuillère    |     8 |          8 |    16 |
    +---------+------------+-------------+-------+------------+-------+
    +---------+------------+-------------+-------+------------+-------+
    | article | reference  | designation | stock | partenaire | total |
    +---------+------------+-------------+-------+------------+-------+
    |      37 | article 37 | fourchette  |     8 |         30 |    38 |
    +---------+------------+-------------+-------+------------+-------+
    +---------+------------+-------------+-------+------------+-------+
    | article | reference  | designation | stock | partenaire | total |
    +---------+------------+-------------+-------+------------+-------+
    |      42 | article 42 | couteau     |    30 |         43 |    73 |
    +---------+------------+-------------+-------+------------+-------+
    +---------+------------+-------------+-------+------------+-------+
    | article | reference  | designation | stock | partenaire | total |
    +---------+------------+-------------+-------+------------+-------+
    |      53 | article 53 | assiette    |    43 |          8 |    51 |
    +---------+------------+-------------+-------+------------+-------+
    +-------+
    | cumul |
    +-------+
    |   178 |
    +-------+
    --------------
    select @total as Total_Général
    --------------
     
    +---------------+
    | Total_Général |
    +---------------+
    |           178 |
    +---------------+
    --------------
    COMMIT
    --------------
     
    Appuyez sur une touche pour continuer...
    Je pense que tu n'as plus trop les idées claires, Devalender.
    Et c'est normal car à force de chercher, tu fatigues !

    Une procédure stockée sous MySql te donnera un seul résultat.
    Dans mon exemple, il s'agit du cumul que je retourne en tant que paramètre de la procédure.
    Si tu veux le détail, il faut alors stocker les résultats intermédiaire dans une table de travail.

    Si tu as besoin d'aide, n'hésite pas.

    Cordialement.
    Artemus24.
    @+

  8. #8
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    Bonjour ! Artemus !

    Citation Envoyé par Artemus24 Voir le message
    Je pense que tu n'as plus trop les idées claires, Devalender.
    Et c'est normal car à force de chercher, tu fatigues !
    ah ca !

    Citation Envoyé par Artemus24 Voir le message
    Une procédure stockée sous MySql te donnera un seul résultat.
    ok, je ne savais pas.

    Citation Envoyé par Artemus24 Voir le message
    DECLARE _tab CURSOR FOR SELECT id, reference, designation FROM `ast_article`;
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
    J'ai beaucoup a apprendre avec Mysql , je me contentais d'une variable pour le curseur !

    Citation Envoyé par Artemus24 Voir le message
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    select _codart        as article,
               _refere        as reference,
               _design        as designation,
               _stock         as stock,
               _part          as partenaire,
               _stock + _part as total;
     
        SET _cumul = _cumul + _stock + _part;
    Ok bien vu ! je n'aurai pas pu résoudre ce problème sans votre intervention !

    Merci beaucoup, c'est super !

  9. #9
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    Citation Envoyé par Artemus24 Voir le message
    Salut à tous.

    Si tu veux le détail, il faut alors stocker les résultats intermédiaire dans une table de travail.

    Si tu as besoin d'aide, n'hésite pas.
    j'aimerai bien que tu m'aide a voir les détails, je ne vois pas comment le faire.
    Merci

  10. #10
    Expert éminent sénior Avatar de Artemus24
    Homme Profil pro
    Agent secret au service du président Ulysses S. Grant !
    Inscrit en
    Février 2011
    Messages
    6 452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Agent secret au service du président Ulysses S. Grant !
    Secteur : Finance

    Informations forums :
    Inscription : Février 2011
    Messages : 6 452
    Points : 19 399
    Points
    19 399
    Par défaut
    Salut Devalender.

    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
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    --------------
    START TRANSACTION
    --------------
     
    --------------
    set session collation_connection = "latin1_general_ci"
    --------------
     
    --------------
    DROP DATABASE IF EXISTS `base`
    --------------
     
    --------------
    CREATE DATABASE IF NOT EXISTS `base`
            DEFAULT CHARACTER SET `latin1`
            DEFAULT COLLATE       `latin1_general_cs`
    --------------
     
    --------------
    DROP TABLE IF EXISTS `Trav`
    --------------
     
    --------------
    CREATE TABLE `Trav`
    ( `codart`       integer unsigned NOT NULL Primary Key,
      `reference`    varchar(255)     NOT NULL,
      `designation`  varchar(255)     NOT NULL,
      `exercice`     integer unsigned NOT NULL,
      `stock`        decimal(15,0)    NOT NULL,
      `partenaire`   decimal(15,0)    NOT NULL
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    DROP TABLE IF EXISTS `ast_article`
    --------------
     
    --------------
    CREATE TABLE `ast_article`
    ( `id`           integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `reference`    varchar(255)     NOT NULL,
      `designation`  varchar(255)     NOT NULL
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ast_article` (`id`,`reference`,`designation`) values
      (25, 'article 25', 'cuillère'),
      (37, 'article 37', 'fourchette'),
      (42, 'article 42', 'couteau'),
      (53, 'article 53', 'assiette')
    --------------
     
    --------------
    select * from `ast_article`
    --------------
     
    +----+------------+-------------+
    | id | reference  | designation |
    +----+------------+-------------+
    | 25 | article 25 | cuillère    |
    | 37 | article 37 | fourchette  |
    | 42 | article 42 | couteau     |
    | 53 | article 53 | assiette    |
    +----+------------+-------------+
    --------------
    DROP TABLE IF EXISTS `ligne_tstock`
    --------------
     
    --------------
    CREATE TABLE `ligne_tstock`
    ( `id`             integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `code_article`   integer unsigned NOT NULL,
      `exercice`       integer unsigned NOT NULL,
      `mouvement`      varchar(255)     NOT NULL,
      `qte_transfert`  decimal(15,0)    NOT NULL,
      unique index `idx` (`code_article`,`exercice`,`mouvement`)
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ligne_tstock` (`code_article`,`exercice`,`mouvement`,`qte_transfert`) values
      (25,2020,'entree',25),(25,2020,'sortie',17),
      (25,2021,'entree',74),(25,2021,'sortie',12),
      (25,2022,'entree',34),(25,2022,'sortie',45),
     
      (37,2020,'entree',55),(37,2020,'sortie',47),
      (37,2021,'entree',68),(37,2021,'sortie',05),
      (37,2022,'entree',21),(37,2022,'sortie',17),
     
      (42,2020,'entree',74),(42,2020,'sortie',44),
      (42,2021,'entree',47),(42,2021,'sortie',25),
      (42,2022,'entree',26),(42,2022,'sortie',07),
     
      (53,2020,'entree',98),(53,2020,'sortie',55),
      (53,2021,'entree',44),(53,2021,'sortie',22),
      (53,2022,'entree',02),(53,2022,'sortie',12)
    --------------
     
    --------------
    select * from `ligne_tstock`
    --------------
     
    +----+--------------+----------+-----------+---------------+
    | id | code_article | exercice | mouvement | qte_transfert |
    +----+--------------+----------+-----------+---------------+
    |  1 |           25 |     2020 | entree    |            25 |
    |  2 |           25 |     2020 | sortie    |            17 |
    |  3 |           25 |     2021 | entree    |            74 |
    |  4 |           25 |     2021 | sortie    |            12 |
    |  5 |           25 |     2022 | entree    |            34 |
    |  6 |           25 |     2022 | sortie    |            45 |
    |  7 |           37 |     2020 | entree    |            55 |
    |  8 |           37 |     2020 | sortie    |            47 |
    |  9 |           37 |     2021 | entree    |            68 |
    | 10 |           37 |     2021 | sortie    |             5 |
    | 11 |           37 |     2022 | entree    |            21 |
    | 12 |           37 |     2022 | sortie    |            17 |
    | 13 |           42 |     2020 | entree    |            74 |
    | 14 |           42 |     2020 | sortie    |            44 |
    | 15 |           42 |     2021 | entree    |            47 |
    | 16 |           42 |     2021 | sortie    |            25 |
    | 17 |           42 |     2022 | entree    |            26 |
    | 18 |           42 |     2022 | sortie    |             7 |
    | 19 |           53 |     2020 | entree    |            98 |
    | 20 |           53 |     2020 | sortie    |            55 |
    | 21 |           53 |     2021 | entree    |            44 |
    | 22 |           53 |     2021 | sortie    |            22 |
    | 23 |           53 |     2022 | entree    |             2 |
    | 24 |           53 |     2022 | sortie    |            12 |
    +----+--------------+----------+-----------+---------------+
    --------------
    DROP TABLE IF EXISTS `ligne_tpartenaire`
    --------------
     
    --------------
    CREATE TABLE `ligne_tpartenaire`
    ( `id`             integer unsigned NOT NULL AUTO_INCREMENT Primary Key,
      `code_article`   integer unsigned NOT NULL,
      `exercice`       integer unsigned NOT NULL,
      `mouvement`      varchar(255)     NOT NULL,
      `qte_transfert`  decimal(15,0)    NOT NULL,
      unique index `idx` (`code_article`,`exercice`,`mouvement`)
    ) ENGINE=InnoDB
      DEFAULT CHARSET=`latin1` COLLATE=`latin1_general_cs`
      ROW_FORMAT=COMPRESSED
    --------------
     
    --------------
    insert into `ligne_tpartenaire` (`code_article`,`exercice`,`mouvement`,`qte_transfert`) values
      (25,2020,'entree',55),(25,2020,'sortie',47),
      (25,2021,'entree',68),(25,2021,'sortie',05),
      (25,2022,'entree',21),(25,2022,'sortie',17),
     
      (37,2020,'entree',74),(37,2020,'sortie',44),
      (37,2021,'entree',47),(37,2021,'sortie',25),
      (37,2022,'entree',26),(37,2022,'sortie',07),
     
      (42,2020,'entree',98),(42,2020,'sortie',55),
      (42,2021,'entree',44),(42,2021,'sortie',22),
      (42,2022,'entree',02),(42,2022,'sortie',12),
     
      (53,2020,'entree',25),(53,2020,'sortie',17),
      (53,2021,'entree',74),(53,2021,'sortie',12),
      (53,2022,'entree',34),(53,2022,'sortie',45)
    --------------
     
    --------------
    select * from `ligne_tpartenaire`
    --------------
     
    +----+--------------+----------+-----------+---------------+
    | id | code_article | exercice | mouvement | qte_transfert |
    +----+--------------+----------+-----------+---------------+
    |  1 |           25 |     2020 | entree    |            55 |
    |  2 |           25 |     2020 | sortie    |            47 |
    |  3 |           25 |     2021 | entree    |            68 |
    |  4 |           25 |     2021 | sortie    |             5 |
    |  5 |           25 |     2022 | entree    |            21 |
    |  6 |           25 |     2022 | sortie    |            17 |
    |  7 |           37 |     2020 | entree    |            74 |
    |  8 |           37 |     2020 | sortie    |            44 |
    |  9 |           37 |     2021 | entree    |            47 |
    | 10 |           37 |     2021 | sortie    |            25 |
    | 11 |           37 |     2022 | entree    |            26 |
    | 12 |           37 |     2022 | sortie    |             7 |
    | 13 |           42 |     2020 | entree    |            98 |
    | 14 |           42 |     2020 | sortie    |            55 |
    | 15 |           42 |     2021 | entree    |            44 |
    | 16 |           42 |     2021 | sortie    |            22 |
    | 17 |           42 |     2022 | entree    |             2 |
    | 18 |           42 |     2022 | sortie    |            12 |
    | 19 |           53 |     2020 | entree    |            25 |
    | 20 |           53 |     2020 | sortie    |            17 |
    | 21 |           53 |     2021 | entree    |            74 |
    | 22 |           53 |     2021 | sortie    |            12 |
    | 23 |           53 |     2022 | entree    |            34 |
    | 24 |           53 |     2022 | sortie    |            45 |
    +----+--------------+----------+-----------+---------------+
    --------------
    DROP PROCEDURE IF EXISTS `inventaire`
    --------------
     
    --------------
    CREATE PROCEDURE `inventaire` ( In  _exercice integer unsigned,
                                    Out _cumul    integer unsigned)
    DETERMINISTIC
    NO SQL
    BEGIN
      DECLARE _codart  INTEGER UNSIGNED  DEFAULT 0;
      DECLARE _refere  VARCHAR(255)      DEFAULT NULL;
      DECLARE _design  VARCHAR(255)      DEFAULT NULL;
      DECLARE _stock   DECIMAL(15,0)     DEFAULT 0;
      DECLARE _part    DECIMAL(15,0)     DEFAULT 0;
     
      DECLARE _fin     INTEGER UNSIGNED  DEFAULT 1;
      DECLARE _tab     CURSOR FOR SELECT id, reference, designation FROM `ast_article`;
      DECLARE CONTINUE HANDLER FOR NOT FOUND SET _fin = 0;
     
      SET _cumul = 0;
     
      OPEN  _tab;
      FETCH _tab INTO _codart, _refere, _design;
     
      WHILE (_fin)
      DO
        SELECT sum(case when mouvement = 'entree' then +coalesce(qte_transfert,0)
                        when mouvement = 'sortie' then -coalesce(qte_transfert,0)
                        else 0 end)
         INTO _stock
         FROM ligne_tstock
        WHERE code_article = _codart
          AND exercice     = _exercice;
     
       SELECT sum(case when mouvement = 'entree' then +coalesce(qte_transfert,0)
                       when mouvement = 'sortie' then -coalesce(qte_transfert,0)
                       else 0 end)
         INTO _part
         FROM ligne_tpartenaire
        WHERE code_article = _codart
          AND exercice     = _exercice;
     
       INSERT INTO `trav` (`codart`,`reference`,`designation`,`exercice`,`stock`,`partenaire`) values (_codart,_refere,_design,_exercice,_stock,_part);
     
          SET _cumul = _cumul + _stock + _part;
     
        FETCH _tab INTO _codart, _refere, _design;
      END WHILE;
      CLOSE _tab;
    END
    --------------
     
    --------------
    set @total = 0
    --------------
     
    --------------
    call `inventaire` (2020, @total)
    --------------
     
    --------------
    select @total as Total_Général
    --------------
     
    +---------------+
    | Total_Général |
    +---------------+
    |           178 |
    +---------------+
    --------------
    select * from trav
    --------------
     
    +--------+------------+-------------+----------+-------+------------+
    | codart | reference  | designation | exercice | stock | partenaire |
    +--------+------------+-------------+----------+-------+------------+
    |     25 | article 25 | cuillère    |     2020 |     8 |          8 |
    |     37 | article 37 | fourchette  |     2020 |     8 |         30 |
    |     42 | article 42 | couteau     |     2020 |    30 |         43 |
    |     53 | article 53 | assiette    |     2020 |    43 |          8 |
    +--------+------------+-------------+----------+-------+------------+
    --------------
    COMMIT
    --------------
     
    Appuyez sur une touche pour continuer...
    Le détail se trouve dans la table Trav.

    Cordialement.
    Artemus24.
    @+

  11. #11
    Membre éprouvé
    Homme Profil pro
    Benevole
    Inscrit en
    Mai 2004
    Messages
    1 701
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Côte d'Ivoire

    Informations professionnelles :
    Activité : Benevole
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 701
    Points : 955
    Points
    955
    Par défaut
    Voila qui est clair, Merci beaucoup et excellente journée.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. combiner deux requetes avec un resultat sur une seule ligne
    Par facteur dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 24/05/2018, 12h42
  2. Problème compilation procédure stockée avec curseur
    Par guillaumerivière7 dans le forum SQL Procédural
    Réponses: 1
    Dernier message: 23/08/2015, 11h11
  3. Lecture d'un fichier qui contient une seule ligne
    Par ysahel dans le forum Débuter
    Réponses: 3
    Dernier message: 20/01/2010, 17h46
  4. Appel d'une procédure stockée avec un curseur
    Par lapanne dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 26/12/2006, 16h24
  5. Procédure stockée avec retour de curseur
    Par Oufti dans le forum MS SQL Server
    Réponses: 7
    Dernier message: 07/11/2005, 22h40

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