Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bonjour à tous,
J'ai une problématique pour la création d'une application avec une grosse volumétrie.
J’ai une base de données qui stocke environ 200 millions de lignes/an sur des données d'essais d'un laboratoire.
Ne pouvant pas vraiment agréger les données sous peine d'altérer les résultats voir de les rendre faux à l'exploitation, je souhaite tout stocker sous forme de QVD.
Cependant, pour une raison de performance, je souhaite que le rechargement ne se fasse pas d'un bloc mais de façon incrémental et mensuel.
J'avais une solution qui fonctionne pour de nombreuses applications et je ne sais pas si c'est la MAJ de Septembre mais ça ne fonctionne plus. j'ai peut-être fait une erreur de saisie mais je ne comprends pas.
Je suis preneur d'une solution pour me debug ou une solution plus fiable.
Voici la solution qui fonctionne :
FlatTable1:
SQL
SELECT
numboucle,
tn,
pstn,
alarmpstn,
statusrn,
statuspn,
StatusFonction,
ncyamprn,
tcyamonn,
tcyamoffn,
tcycoprn,
horodatage,
Qbn,
Qpn1,
Qpn2,
Qpn3,
Qpn4,
Qpn5,
Qpn6,
Qpn7,
Qpn8
FROM E11.dbo."T_boucle" bo
where Year(horodatage) = Year(getdate())
and Month(horodatage) = Month(getdate());
FlatTable2:
LOAD
numboucle,
tn,
pstn,
alarmpstn,
statusrn,
statuspn,
StatusFonction,
ncyamprn,
tcyamonn,
tcyamoffn,
tcycoprn,
horodatage,
Qbn,
Qpn1,
Qpn2,
Qpn3,
Qpn4,
Qpn5,
Qpn6,
Qpn7,
Qpn8
Resident FlatTable1;
Drop Table FlatTable1;
Let vAnnee = Year(Today());
Let vMois = num(Month(Today()));
Let vQvdExiste = not isnull(QvdCreateTime('[lib://Qvd (wilo_xxx)/Extraction\E11\$(vAnnee)\FlatTable_$(vAnnee)_$(vMois).QVD]'));
If $(vQvdExiste) then
Concatenate
LOAD
numboucle,
tn,
pstn,
alarmpstn,
statusrn,
statuspn,
StatusFonction,
ncyamprn,
tcyamonn,
tcyamoffn,
tcycoprn,
horodatage,
Qbn,
Qpn1,
Qpn2,
Qpn3,
Qpn4,
Qpn5,
Qpn6,
Qpn7,
Qpn8
FROM [lib://Qvd (wilo_xxx)/Extraction\E11\$(vAnnee)\FlatTable_$(vAnnee)_$(vMois).QVD](qvd)
where Year(horodatage) = Year(Today())
and Month(horodatage) = Month(Today());
End If
Store FlatTable2 into [lib://Qvd (wilo_xxx)/Extraction/E11/FlatTable_$(vAnnee)_$(vMois).QVD](qvd);
Drop Table FlatTable2;
Voici la solution qui ne marche pas :
Mesure:
SQL
SELECT
Idmesure,
Horodatage,
"Tamb_C",
"HR_pc",
"Pcold_bar",
"Patm_mbar",
"Tcold_C",
"Tp1_C",
"Tp2_C",
"Tp3_C",
"Tp4_C",
"Qp1_lh",
"Qp2_lh",
"Qp3_lh",
"Qp4_lh",
"Tcold_alarm",
"Pcold_alarm",
"Error_code",
"Error_source"
FROM COLDGROUP.dbo."T_mesure"
where Year(Horodatage) = Year(getdate())
and Month(Horodatage) = Month(getdate());
LOAD
Idmesure,
Horodatage,
"Tamb_C",
"HR_pc",
"Pcold_bar",
"Patm_mbar",
"Tcold_C",
"Tp1_C",
"Tp2_C",
"Tp3_C",
"Tp4_C",
"Qp1_lh",
"Qp2_lh",
"Qp3_lh",
"Qp4_lh",
"Tcold_alarm",
"Pcold_alarm",
"Error_code",
"Error_source"
Resident Mesure;
Drop Table Mesure;
Let vAnnee = Year(Today());
Let vMois = num(Month(Today()));
LetvQvdExiste=notisnull(QvdCreateTime('[lib://Qvd(wilo_heaudi)/Extraction\Laboratoire\ColdGroup\Mesure_$(vAnnee)_$(vMois).QVD]'));
If $(vQvdExiste) then
Concatenate
LOAD
Idmesure,
Horodatage,
"Tamb_C",
"HR_pc",
"Pcold_bar",
"Patm_mbar",
"Tcold_C",
"Tp1_C",
"Tp2_C",
"Tp3_C",
"Tp4_C",
"Qp1_lh",
"Qp2_lh",
"Qp3_lh",
"Qp4_lh",
"Tcold_alarm",
"Pcold_alarm",
"Error_code",
"Error_source"
FROM [lib://Qvd (wilo_heaudi)/Extraction\Laboratoire\ColdGroup\Mesure_$(vAnnee)_$(vMois).QVD](qvd)
where Year(Horodatage) = Year(Today())
and Month(Horodatage) = Month(Today()) ;
End If
Store Mesure1 into [lib://Qvd (wilo_heaudi)/Extraction/Laboratoire/ColdGroup/Mesure_$(vAnnee)_$(vMois).QVD](qvd);
Drop Table Mesure1;
Merci de votre aide.
Je suis à votre écoute.
Bonne journée.