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
| DecodeDate(d_m.db_sessionses_date.Value,annee,mois,jour);
{Construction du query d'insertion }
text_query:='INSERT INTO `bd_asso`.`db_ligne_session` ( ' +
'`ses_recid`,`lig_bnf_recid`,`lig_date_session`,`lig_num_carte`,'+
'`lig_bnf_nom`,`lig_nbre_pers`,`lig_mt_total`,`lig_mt_paye`,`lig_mt_du`,'+
'`lig_colis_alim`,`lig_nbre_colis`,`lig_mt_colis`,'+
'`lig_bon_bebe`,`lig_nbre_bon_bebe`,`lig_mt_bon_bebe`,'+
'`lig_bon_piscine`,`lig_nbre_piscine`,`lig_mt_bon_piscine`,'+
'`lig_bon_cine`,`lig_nbre_cine`,`lig_mt_bon_cine`,'+
'`lig_bon_gaz`,`lig_nbre_blle_gaz`,`lig_mt_bon_gaz`,'+
'`lig_colis_urgence`,`lig_nbre_urgence`,`lig_mt_colis_urgence`,'+
'`lig_vetement`,`lig_mt_vetement`,'+
'`lig_divers`,`lig_nbre_divers`,`lig_mt_divers`) '+
' VALUES ('' ' +
IntToStr(d_m.db_sessionses_recid.Value)+
''',''' +
IntToStr(d_m.db_benefrecid.Value)+
''',''' +
IntToStr(annee)+'-'+IntToStr(mois)+'-'+IntToStr(jour)+
''',''' +
IntToStr(d_m.db_benefrecid.Value)+
''',''' +
d_m.db_benefbnf_nom.Value+
''',''' +
IntToStr(v_nbre_pers) +
''',''' +
FloatToStr(tot_grd_total_jour.Value) +
''',''' +
FloatToStr(tot_paye_jour.Value) +
''',''' +
FloatToStr(tot_nouveau_solde.Value) +
''',''' ;
if qt_colis_alim.Value<>0 Then text_query:=text_query + '1' + ''','''
Else text_query:=text_query + '0' + ''',''' ;
if qt_colis_alim.Value<>0 Then text_query:=text_query + FloatToStr(qt_colis_alim.Value) + ''','''
Else text_query:=text_query + '0' + ''',''' ;
if qt_colis_alim.Value<>0 Then text_query:=text_query + FloatToStr(prix_colis.Value) + ''','''
ELse text_query:=text_query + '0' + ''',''' ;
if qt_bon_bebe.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_bon_bebe.Value<>0 Then text_query:=text_query + FloatToStr(qt_bon_bebe.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_bon_bebe.Value<>0 Then text_query:=text_query +FloatToStr(prix_bon_bebe.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_piscine.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_piscine.Value<>0 Then text_query:=text_query +FloatToStr(qt_piscine.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_piscine.Value<>0 Then text_query:=text_query +FloatToStr(prix_piscine.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_cinema.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_cinema.Value<>0 Then text_query:=text_query +FloatToStr(qt_cinema.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_cinema.Value<>0 Then text_query:=text_query +FloatToStr(prix_cinema.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_blle_gaz.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_blle_gaz.Value<>0 Then text_query:=text_query + FloatToStr(qt_blle_gaz.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_blle_gaz.Value<>0 Then text_query:=text_query +FloatToStr(prix_gaz.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if qt_colis_urgence.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
text_query:=text_query +FloatToStr(qt_colis_urgence.Value) + ''',''';
if qt_colis_urgence.Value<>0 Then text_query:=text_query +FloatToStr(tot_colis_urgence.Value) + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if tot_vetements.Value<>0 Then text_query:=text_query + '1' + ''','''
ELse text_query:=text_query +'0' + ''',''';
if tot_vetements.Value<>0 Then text_query:=text_query +FloatToStr(tot_vetements.Value) + ''','''
ELse text_query:=text_query + '0' + ''',''' ;
if tot_autres.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if tot_autres.Value<>0 Then text_query:=text_query +'1' + ''','''
ELse text_query:=text_query +'0' + ''',''' ;
if tot_autres.Value<>0 Then text_query:=text_query +FloatToStr(tot_autres.Value)+ ''')'
ELse text_query:=text_query +'0' + ''')' ;
With D_m.sql_requeteur Do
Begin
SQL.Clear;
SQL.Add(text_query);
Try
ExecSQL;
Except
Showmessage('problème sur la création d''une ligne session'+ #13 + text_query);
End;
End; |
Partager