Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Single result set from Multiple Remote Databases |
Wed, Jun 26 2013 10:20 PM | Permanent Link |
Kreg Jetsel | I have 4 remote DBIsam databases - all with the same table names, structures, etc. The tables contain basic customer information. I would like to populate a grid with the customer lists from all 4 databases. What would be the best way to accomplish this? Is it possible to write one query against all 4 Databases at the same time? Any help would be greatly appreciated.
|
Thu, Jun 27 2013 6:03 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Kreg
>I have 4 remote DBIsam databases - all with the same table names, structures, etc. The tables contain basic customer information. I would like to populate a grid with the customer lists from all 4 databases. What would be the best way to accomplish this? Is it possible to write one query against all 4 Databases at the same time? Any help would be greatly appreciated. A couple of questions need answering first: Is this c/s or f/s? (If the former then you'll need to stream the data back to the machine doing the consolidation, if fileserver then it may be possible to use a script.) How much data is involved? Is a query being used to extract data or is it everything in the table wanted? As an example this is a post from 2003 by Robert to run a remote query and move the result to a local table. procedure TDM.RemoteToLocal(RDS, LDS: tDBISAMDataSet; OpenLocal: Boolean; CreateLocal : Boolean = True); var M : tMemoryStream; begin If not RDS.Active then RDS.Open; If LDS is tDBISAMTable then begin LDS.Close; If CreateLocal then begin (LDS as tDBISAMTable).DeleteTable; (LDS as tDBISAMTable).CreateTable; end; (LDS as tDBISAMTable).IndexFieldNames := ''; (LDS as tDBISAMTable).DeleteAllIndexes; (LDS as tDBISAMTable).IndexDefs.Clear; end; If not LDS.Active then LDS.Open; try M := tMemoryStream.Create; RDS.SaveToStream(M); LDS.LoadFromStream(M); Finally M.Free; end; RDS.Close; LDS.Close; If OpenLocal then LDS.Open; end; One you have all the tables local then you can use a simple query using UNION Roy Lambert [Team Elevate] |
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |