Recent

Author Topic: How to duplicate a DataSet to a Local Table or Cursor  (Read 293 times)

erictan

  • Jr. Member
  • **
  • Posts: 54
How to duplicate a DataSet to a Local Table or Cursor
« on: October 02, 2020, 04:42:22 am »
After doing a SELECT to extract data from the Firebird Database into a DataSet,
how can I create a local cursor or local table to copy the DataSet data for offline processing.

I want to apply this method to many Lockup tables whereby I want to use only one set of
dbcConnection, sqlTransaction, sqlQuery and DataSource component to extract the Lookup tables from the Firebird Database
into local Cursor or local Tables.

Any help is appreciated.

« Last Edit: October 02, 2020, 06:08:18 am by erictan »

cdbc

  • Sr. Member
  • ****
  • Posts: 274
    • http://www.cdbc.dk
Re: How to duplicate a DataSet to a Local Table or Cursor
« Reply #1 on: October 02, 2020, 06:37:35 am »
Hello
1) Have a look at TMemDataset or TBufDataset,
    TMemDataset has the ability to copy from another
    dataset fielddefs and data.

2) I've done something like that, only with SQLite3 db,
    the sql is very simple and should run on Firebird.
    Source code is enclosed in "transfer.zip", have a look at the TLiteDb <-> Bom_HK <-> lfm_main connections.
    - ReadDb
    - UpdateDb
You can pick'n'choose in the code, it may help as point to start.... ;)
Regards Benny
If it ain't broke, don't fix it ;)

erictan

  • Jr. Member
  • **
  • Posts: 54
Re: How to duplicate a DataSet to a Local Table or Cursor
« Reply #2 on: October 02, 2020, 12:05:41 pm »
Thank you Benny,
I will study your sample code.
Your help is much appreciated.

 

TinyPortal © 2005-2018