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
| oq.Close;
oq.SQL.Clear;
oq.SQL.Add('select POIXENT as TOTO from ENTXRES where NUMXENT=:num');
oq.DeclareAndSet('num', otInteger, StrToInt(sNum));
TestRequete1(oq, 'OPENREQ', 'Echec recup poixent (UnitPrepCmd - 100)', osOracleSession);
// Calcul poids à soustraire
dPoids := 0;
if not oq.Eof then
dPoids := oq.FieldAsFloat('TOTO');// - (dAncpoids + dNvPoids); Ne change rien tjs numéro/nom de variable interdit
//oq.SQL.Add('update ENTXRES set BLEXENT=''N'''); code original
oq.Close;
oq.SQL.Clear;
if liRupture>0 then
begin
//oq.SQL.Add(', POIXENT=POIXENT - ('''+FloatToStr(dAncpoids)+''' + '''+FloatToStr(dNvPoids)+''')');
//oq.SQL.Add(', POIXENT=POIXENT - (:APoi + :NPoi)'; code original
oq.SQL.Add('update ENTXRES set BLEXENT=''N'', POIXENT=:poi where NUMXENT=:num');
//oq.DeclareAndSet('Apoi', otFloat, dAncpoids);
//oq.DeclareAndSet('NPoi', otFloat, dNvPoids);
oq.DeclareAndSet('poi', otFloat, dPoids);
oq.DeclareAndSet('num', otInteger, StrToInt(sNum));
TestRequete1(oq, 'EXECUTE', 'Echec maj blexent, poixent, regxent, mplxent, calxent (UnitPrepCmd - 051)', osOracleSession);
end
else
if bRuptureTotale=True then
begin
oq.SQL.Add('update ENTXRES set BLEXENT=''N''');
oq.SQL.Add(',REGXENT=0,MPLXENT=0,CALXENT=''Y''');
oq.SQL.Add('where NUMXENT=:inum');
oq.DeclareAndSet('inum', otInteger, StrToInt(sNum));
TestRequete1(oq, 'EXECUTE', 'Echec maj blexent, poixent, regxent, mplxent, calxent (UnitPrepCmd - 051)', osOracleSession);
end
else
begin
oq.SQL.Add('update ENTXRES set BLEXENT=''N''');
oq.SQL.Add('where NUMXENT=:inum');
oq.DeclareAndSet('inum', otInteger, StrToInt(sNum));
TestRequete1(oq, 'EXECUTE', 'Echec maj blexent, poixent, regxent, mplxent, calxent (UnitPrepCmd - 051)', osOracleSession);
end; |