Subject Re: Copy table from server to local table...
From Jose <jose.fdezdelvalle@mx.ey.com>
Date Wed, 22 Feb 2017 17:21:22 -0500
Newsgroups dbase.getting-started

Mervyn Bick Wrote:

>
> Have a look at updateSet class in the help file.  This has an example of
> exactly what you need.
>
> If you are going to copy more than one table you need to null u after
> each table.
>
> Mervyn.
>


Jose Wrote:

Thanks Mervyn !!!
This is great !!!

-----------------------------------------------------------------------

The following example copies the result set from a query on an SQL-based-server to a local DBF file:

d = new Database()
d.databaseName = "SOMESQL"
d.active = true
q = new Query()
q.database = d
q.sql = "select * from SOMETABLE where THIS = 'that' order by ID"
q.active = true
u = new UpdateSet()
u.source = q.rowset
u.destination = "RESULTS.DBF"
u.copy()

This example copies all the rows from the same SQL-based-server table to a local DBF file without using a Query object:

d = new Database()
d.databaseName = "SOMESQL"
d.active = true
u = new UpdateSet()
u.source = ":SOMESQL:SOMETABLE"
u.destination = "SOMEDUP.DBF"
u.copy()