Page 1 of 1

Changed Behaviour with Options.Autoprepare

Posted: Sun 29 Dec 2013 19:46
by jfudickar
Hi,

with the new version 9.2 I have a problem with the attached code.
It's no longer working. I have to deactivate the Autoprepare := true line.

Why? This code has worked for a long time.

Regards
Jens

Code: Select all

function TForm1.HasSystemPrivilege(const Privilege: string): boolean;
var
  Query: TOraQuery;
begin
  Query := TOraQuery.Create(self);
  try
    try
      Query.OptionsDS.AutoPrepare := True;
      Query.SQL.Add('SELECT  2 ');
      Query.SQL.Add('  FROM  SESSION_PRIVS');
      Query.SQL.Add('  WHERE PRIVILEGE =:PRIVILEGE');
      Query.ParamByName('PRIVILEGE').AsString := Uppercase(trim(Privilege));
      Query.Execute;
      Result := not Query.EOF;
      Query.Close;
    except
      on e: Exception do
        Result := False;
    end;
  finally
    Query.Free;
  end;
  if Result then
    Memo1.Lines.Add(Format('%s granted',[Privilege]))
  else
    Memo1.Lines.Add(Format('%s not granted',[Privilege]));
end;

Re: Changed Behaviour with Options.Autoprepare

Posted: Mon 30 Dec 2013 11:49
by AlexP
Hello,

We cannot reproduce the problem on the latest ODAC version. We have checked your sample, and on setting the parameter to the 'CREATE SESSION' value, your method always returns true, independently on the AutoPrepare parameter value. Please specify your IDE version, client version (if the OCI mode is used) and Oracle server version. In addition, send a small sample reproducing the problem to Alexp*devart*com

Re: Changed Behaviour with Options.Autoprepare

Posted: Thu 02 Jan 2014 15:32
by jfudickar
It's on the way :-)