TOracleDataSet error ??

Zugg

Member²
Hello,

i have some problems executing this part of code
qry1 is an TOracleDataSet
qry1.SQL = SELECT T1.*, T1.rowid FROM T1
Variable in qry1 : vVAR1 : otString

param : Extended;
val1 : integer;
val2 : String;

Code:
param := Now;
    try
      try
        err := '0';
        qry1.CloseAll ;  // Close;
        qry1.ClearVariables ;
        qry1.SetVariable('vVAR1', param) ;
        qry1.Open ;
        err := '1';
        if (not qry1.Eof) then
        begin
          err := '2';
          qry1.First ;
          val1 := qry1.FieldByName('COL1').AsInteger ;
          val2 := qry1.FieldByName('COL2').AsString ;
          {*** Treatement ***}
        end
      except
        on E : Exception do
        begin
          WriteLog(err + ' - ' + E.Message) ;
        end ;
      end ;
    finally
       qry1.ClearVariables ;
       qry1.CloseAll;
    end ;
Here are the logs :

Log 1 : after N treatement i have this error :
> 0 - Violation d'acc
 
I'm not sure where the access violations come from, but I don't see a vVAR1 variable in the SQL text. This would cause an "ORA-01036: illegal variable name/number" error.
 
Hi,

i have replace the TOracleDataSet with a TOracleQuery and it's work now.

But the real problem was probably due to a concurrency access to the TOracleDataSet (or TOracleQuery) object.

Thanks...
 
Back
Top