Table copy

Thomas Flemming tf at ttqv.com
Wed Apr 14 04:43:31 CDT 2010


Hi Ruslan,

 > Which exactly way you did try?

Copy whole table from one database to another:

  ' 1. copy structure
  fn = Helper.TempFile
  db_source.Table(tblname_source).Dump(fn, EVDumpType.kSQL,
                                       EVDataKind.kStructureOnly)
  Helper.ReplaceInFile(fn, tblname_source, tblname_dest)
  db_dest.SqlExecute(My.Computer.FileSystem.ReadAllText(fn))

  ' 2. copy records
  fn = Helper.TempFile
  db_source.Table(tblname_source).Dump(fn, EVDumpType.kSQL,
                                       EVDataKind.kRecordsOnly)
  Helper.ReplaceInFile(fn, tblname_source, tblname_dest)
  db_dest.Table(tblname_dest).LoadDump(fn, EVDumpType.kSQL)


 >
 > Import/export must be very fast.

this cant be fast, because it writes the whole content of the table in a file 
on the harddisk.
Or did I miss something ;-) ?

 >
 > XML is slowest way.
 > SQL average



Tom



Am 14.04.2010 08:34, schrieb Ruslan Zasukhin:
> On 4/13/10 8:22 PM, "Thomas Flemming"<tf at ttqv.com>  wrote:
>
> Hi Thomas,
>
>>> To move records between dbs you should use
>>>
>>> A) text export/import
>>> B) Sql export/import
>>> C) XML export/import
>>>
>>> On your choice.
>>
>> I tried it now, and its sloooooow....
>
> Which exactly way you did try?
>
> Import/export must be very fast.
>
> XML is slowest way.
> SQL average
>
>> Dont you have at least something, which doesn't write the stuff to a file on
>> the harddisk first? Maybe using a memory-stream?
>>
>> Even my old MS Access 97 could do a
>> "INSERT INTO dest_vdb.newtbl SELECT * FROM source_vdb.sourcetbl"
>> from one db to another and this is faaaaast...
>>
>> I'll put this on mantis.
>
> Yes, we do not have such thing.
>

-- 
/****************************************
**   Dipl.-Ing. Thomas Flemming
**   Software Development
**
**   Touratech AG
**   Auf dem Zimmermann 7-9
**   D-78078 Niedereschach
**
**   mail  tf at ttqv.com
**   fon   +49 (0) 7728 9279-206
**   fax   +49 (0) 7728 9279-29
**
**   http://www.ttqv.com
**   http://www.touratech.de
**
**   ... und immer dem Pfeil nach!
***************************************/


More information about the Valentina mailing list