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 Firebird Discussion :

overflow occured during datatype conversion.


Sujet :

SQL Firebird

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Juin 2009
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 246
    Par défaut overflow occured during datatype conversion.
    bonjour,
    J'ai créer une procédure qui doit calculer des statistiques de ventes suivant divers paramètre par reference article.
    Elle se décompose en 2 requete que je joint avec union.
    La première recupere les info des produits qui ont eu des ventes, la secondes celle des produits qui n'ont pas eu de vente (nouveaux produit par exemple).
    mon problème vient du fait que chaque requete fonctionne séparemment mais une fois reunies j'ai une erreur

    "overflow occured during datatype conversion.
    Conversion error from string Q (ou Q est le parametre que j'ai entré)
    At procedure "pst_stat_par_remiseligne" line 21 : col 2.


    voici mon code :
    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
    begin
     FOR select   t_stock.refarticle, t_stock.remlig, t_rupturestocks.nbsemaines_rupt_fini,
             t_rupturestocks.nbsemaines_rupt_brut, sum(t_cumulca.cumulqte) as qte_vendu,
             t_stock.stkminifini, t_stock.stkminibrut, t_stock.louchecde, t_stock.louchepla,
             (t_stock.a + t_stock.t + t_stock.m + t_stock.r + t_stock.p + t_stock.s ) as qte_placage,
             t_stock.f,  (t_stock.b + t_stock.e) as qte_brut, sum(t_cumulcamoins.cumulqte) as qte_vendumoins,
             t_cumulcastock.stkminifini, t_cumulcastock.stkminibrut
     
    from t_stock
                left outer join t_cumulca on (t_stock.refarticle = t_cumulca.refarticle)
                left outer join t_rupturestocks on (t_stock.refarticle = t_rupturestocks.refarticle)
                left outer join t_cumulca as t_cumulcamoins on (t_stock.refarticle = t_cumulcamoins.refarticle)
                left outer join t_cumulca as t_cumulcastock on (t_stock.refarticle = t_cumulcastock.refarticle )
    where
    t_stock.remlig = :remlig and
    t_cumulca.annee = extract(year from current_date)
                                          and t_cumulcamoins.annee = (extract(year from current_date) -1)
                                          and t_cumulcastock.annee = (extract(year from current_date) -1) and t_cumulcastock.mois = 12
     
    group by t_stock.refarticle,t_stock.remlig, t_rupturestocks.nbsemaines_rupt_fini,
             t_rupturestocks.nbsemaines_rupt_brut,t_stock.stkminifini, t_stock.stkminibrut, t_stock.louchecde,
             t_stock.louchepla, qte_placage, t_stock.f, qte_brut, t_cumulcastock.stkminifini, t_cumulcastock.stkminibrut
     
    union
    select   t_stock.refarticle, t_stock.remlig, t_rupturestocks.nbsemaines_rupt_fini,
             t_rupturestocks.nbsemaines_rupt_brut, sum(t_cumulca.cumulqte) as qte_vendu,
             t_stock.stkminifini, t_stock.stkminibrut, t_stock.louchecde, t_stock.louchepla,
             (t_stock.a + t_stock.t + t_stock.m + t_stock.r + t_stock.p + t_stock.s ) as qte_placage,
             t_stock.f,  (t_stock.b + t_stock.e) as qte_brut, sum(t_cumulcamoins.cumulqte) as qte_vendumoins,
             t_cumulcastock.stkminifini, t_cumulcastock.stkminibrut
     
    from t_stock
                left outer join t_cumulca on (t_stock.refarticle = t_cumulca.refarticle)
                left outer join t_rupturestocks on (t_stock.refarticle = t_rupturestocks.refarticle)
                left outer join t_cumulca as t_cumulcamoins on (t_stock.refarticle = t_cumulcamoins.refarticle)
                left outer join t_cumulca as t_cumulcastock on (t_stock.refarticle = t_cumulcastock.refarticle )
    where
    t_stock.remlig = :remlig  and t_stock.refarticle not in (select t_cumulca.refarticle from t_cumulca)
    group by t_stock.refarticle,t_stock.remlig, t_rupturestocks.nbsemaines_rupt_fini,
             t_rupturestocks.nbsemaines_rupt_brut,t_stock.stkminifini, t_stock.stkminibrut, t_stock.louchecde,
             t_stock.louchepla, qte_placage, t_stock.f, qte_brut, t_cumulcastock.stkminifini, t_cumulcastock.stkminibrut
    into
          :refarticle,
          :remligout,
          :nbsemaines_rupt_fini,
          :nbsemaines_rupt_brut,
          :qte_vendu,
          :stkminifini,
          :stkminibrut,
          :louchecde,
          :louchepla,
          :qte_placage,
          :f,
          :qte_brut,
          :qte_vendumoins,
          :stkminifinimoins,
          :stkminibrutmoins
     
    do
    suspend;
    end
    le paramètre d'entrée est remlig (ils correspond au code famille, historique entreprise oblige)

  2. #2
    Membre confirmé
    Inscrit en
    Juin 2009
    Messages
    246
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 246
    Par défaut
    j'ai corrigé le problème en modifiant ma requete comme suit :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    where
    t_stock.remlig = :remligand
    ((t_cumulca.annee = extract(year from current_date)
                                          and t_cumulcamoins.annee = (extract(year from current_date) -1)
                                          and t_cumulcastock.annee = (extract(year from current_date) -1) and t_cumulcastock.mois = 12)
                                          or (t_stock.refarticle not in (select t_cumulca.refarticle from t_cumulca)))
    maintenant si quelqu'un saurait m'éclairer sur le pourquoi du comment de ma première erreur, j'avoue que j'aimerai bien comprendre.

    Edit :
    j'avais tout simplement sans le faire expret modifier un parametre de sortie varchar vers Int.

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

Discussions similaires

  1. Error occurred during initialization of VM
    Par LaSirenne dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 18/02/2008, 15h26
  2. Réponses: 4
    Dernier message: 03/10/2007, 14h56
  3. Problem an internal error occured during :" lunching"
    Par Dev_info dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 24/04/2007, 13h09
  4. Error occurred during initialization of VM
    Par Emilie MARQUOIS-OGEZ dans le forum Langage
    Réponses: 2
    Dernier message: 27/11/2006, 11h48
  5. Réponses: 2
    Dernier message: 27/09/2005, 16h32

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