Changed Behaviour with Options.Autoprepare

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Changed Behaviour with Options.Autoprepare

Post by jfudickar » Sun 29 Dec 2013 19:46

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;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Changed Behaviour with Options.Autoprepare

Post by AlexP » Mon 30 Dec 2013 11:49

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

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Re: Changed Behaviour with Options.Autoprepare

Post by jfudickar » Thu 02 Jan 2014 15:32

It's on the way :-)

Post Reply