Page 1 of 1

static resultset

Posted: Thu 30 Jun 2011 11:01
by AnHa
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.

Posted: Thu 30 Jun 2011 11:33
by AndreyZ
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.

Posted: Thu 30 Jun 2011 12:00
by AnHa
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?

Posted: Fri 01 Jul 2011 07:17
by AlexP
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.