#1 Re: mORMot 1 » TSQLDBStatement.FetchAllAsJSON ORA-24391 invalid fetch operation » 2015-05-27 19:53:20

Hi,

Changed to:

 TSQLDBOracleStatement 

now work 100%, very fast.

Thank You

#2 Re: mORMot 1 » TSQLDBStatement.FetchAllAsJSON ORA-24391 invalid fetch operation » 2015-05-27 17:06:27

Hi,

Thank you for responding so quickly, I Changed to:

 Result:= Q.PreparedSQLDBStatement.FetchAllAsJSON(True, nil, True); 

and the error ORA-24391 remains

I tested with:

 Result:= Q.PreparedSQLDBStatement.FetchAllAsJSON(True, nil, False); 

and work correctly, but the first raw data is missing

TIA

#3 mORMot 1 » TSQLDBStatement.FetchAllAsJSON ORA-24391 invalid fetch operation » 2015-05-27 14:42:56

LuizLH
Replies: 5

Hi,

I have a Server Oracle on Linux
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

My Application
Lib: mORMotNightlyBuild.zip
Delphi XE7 - Target Platforms (Win32)
Windows 7

Test Code:

function TTestServer.ExecQuery(prFileName: String; prParams: TStrings): RawUTF8;
var
  q: TQuery;
  i: Integer;
  ct: SynCommons.PPtrInt;
begin
  q := TQuery.Create(fProps.ThreadSafeConnection);
  try
    Q.SQL.Clear; 
    Q.SQL.LoadFromFile(prFileName);
    for i := 0 to prParams.Count-1 do
      Q.ParamByName(prParams.Names[i]).AsString := prParams.Values[prParams.Names[i]];
    Q.Open;
    Q.First;    
    Result:= Q.PreparedSQLDBStatement.FetchAllAsJSON(True, ct, True);
  finally
    q.Free;
  end;
end;

The Problem:
Line -> Result:= Q.PreparedSQLDBStatement.FetchAllAsJSON(True, ct, True);

When I execute the function with these parameters FetchAllAsJSON(True, ct, True)
I get the error ORA-24391

When I execute the function with these parameters FetchAllAsJSON(True)
Thats OK, but the first row of data is missing

What am I doing wrong?

TIA

Board footer

Powered by FluxBB