Bonjour,

J'ai un soucis sur une requête qui me met "Numéro nom de variable interdit" J'ai essayé pleins de modifications sans succès :

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
      oq.Close;
      oq.SQL.Clear;
      oq.SQL.Add('select POIXENT as POIDS 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('POIDS');// - (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=:inum');
        //oq.DeclareAndSet('Apoi', otFloat, dAncpoids);
        //oq.DeclareAndSet('NPoi', otFloat, dNvPoids);
        oq.DeclareAndSet('poi', otFloat, dPoids);
        oq.DeclareAndSet('inum', otInteger, StrToInt(sNum));
        TestRequete1(oq, 'EXECUTE', 'Echec maj blexent, poixent, regxent, mplxent, calxent (UnitPrepCmd - 051)', osOracleSession);
      end
D'où cela peut-il venir ?