How to "clone" a TOraQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Eric
Posts: 16
Joined: Thu 20 Jan 2005 13:54
Location: France

How to "clone" a TOraQuery

Post by Eric » Mon 03 Oct 2005 14:33

Hi,

Is there a simple way to entirely copy a TOraQuery (with its results, preparation, position, dataset, etc...).

NB: it is to always use the same TOraQuery in a recursive loop...

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Tue 04 Oct 2005 07:22

You can use the following code to implement necessary functionality,
but notice that you need to specify KeyFields or include RowId field in select statement:
OraQuery1 - base query
OraQuery2 - "clone" query

Code: Select all

  OraQuery2.Assign(OraQuery1);
  OraQuery2.Open;
  OraQuery2.GotoCurrent(OraQuery1);
This solution doesn't assign OraQuery1 results to OraQuery2, so data fetch will be performed once more.

Post Reply