static resultset

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AnHa
Posts: 8
Joined: Wed 09 Feb 2011 13:42

static resultset

Post by AnHa » Thu 30 Jun 2011 11:01

I sometimes need a static resultset, which means: the server table is queried and subsequent sql operations don't affect that resultset.
In ADO I used Cursortype ctStatic but in Unidac I can't find something like that.
I have to process very large table sizes and if there is a way to do that without copying to a local VirtualTable it would be helpfull. The resultset is ReadOnly and UniDirectional.

AndreyZ

Post by AndreyZ » Thu 30 Jun 2011 11:33

Hello,

For the time being UniDAC doesn't have the CursorType option. You can use SDAC instead. SDAC supports working with cursors through the CursorType property. For more information, please refer to the SDAC documentation.

AnHa
Posts: 8
Joined: Wed 09 Feb 2011 13:42

Post by AnHa » Thu 30 Jun 2011 12:00

Thank you for your fast answer.
SDAC is no option as the database in question is Oracle. The CursorType ctStatic was more an example from my previous work with ADO. Is it possible to get a not changing resultset in Unidac?
Is the disconnected mode not something similar?

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

Post by AlexP » Fri 01 Jul 2011 07:17

Hello,

There is no CursorType property in ODAC and UniDAC. But you can use a procedure/function that returns the SYS_REFCURSOR type, for example:

Code: Select all

CREATE OR REPLACE
FUNCTION GET_ALL_DATA RETURN SYS_REFCURSOR
AS
  CUR SYS_REFCURSOR;
BEGIN
  OPEN CUR FOR SELECT * FROM T_TABLE;
  RETURN cur;
END;

Code: Select all

var
  UniQuery: TUniQuery;
begin
  UniQuery:= TUniQuery.Create(nil);
  UniQuery.Connection:= UniConnection;
  UniQuery.SQL.Text := 'begin select get_all_data into :cur from dual; end;';
  UniQuery.ParamByName('cur').DataType := ftCursor;
  UniQuery.Open;
  UniDataSource1.DataSet:=UniQuery;
We are considering the possibility of adding the CursorType property in one of the future versions.

Post Reply