Subject Re: [firebird-support] Bulk upload options
Author hamacker
months ago, I test method load data  from script  (sorry I dont test load from csv) and transfer source/to.
Well, script is fast, but when error occour you need to correct file and try again and it´s not easy edit from huge file (only gvim app  I can manipulate fast)
Easy method that I choose requires backup from database production to local SSD drive and recreate .fdb 
After this, transfer from local database-backup to local destiny using parametrizes queries.
It´s fast, but you need to commit after several inserts because after some times the transaction will be slow down.

In delphi is possible to create a generic function to assign value to all fields that correspont parameter in destiny and field source/to. I do that 'cause I had many tables to transfer.

good lucky.


Em qua, 16 de mai de 2018 às 13:29, fabianch@... [firebird-support] <firebird-support@yahoogroups.com> escreveu:
Well, let's think this through

When firebird executes the following command it does it extremelly quickly:

Insert into Table
Select * from Table

That probably is because the sentence insert into table expects multiple
results from the Select statement.

isql on the other hand will have to execute an insert per record, unless I
could say:

Insert into Table
Values (a,b,c)
+ (next record)
Values (a2,b2,c2)
+ etc

Is there a sentence in Firebird that would allow inserting multiple records
from a TXT file?
Perhaps defining an external file table, with the contents of what I want to
upload, and executing:

Insert into Target Table
Select * from External TXT File, and if the TXT file is on an SSD HDD one
would assume this would fly, right??

Cheers,
Fabian



----- Original Message -----
From: "Dimitry Sibiryakov sd@... [firebird-support]"
<firebird-support@yahoogroups.com>
To: <firebird-support@yahoogroups.com>
Sent: Wednesday, May 16, 2018 7:10 PM
Subject: Re: [firebird-support] Bulk upload options


> 16.05.2018 4:48, fabianch@... [firebird-support] wrote:
>> Does anyone have experience with bulk updates via isql? Would it be X
>> times faster than using a normal application inserting the records inside
>> a begin transaction and commit at the end?
>
>   No, because it is exactly what isql does: execute a prepared statement
> for each line of
> data. No magic inside.
>
>> I think this solutions will do!!!!
>
>   External tables has a definite limitations, for example you cannot put
> NULL into it. If
> it is ok for you - fine. Otherwise the fastest way is export data into a
> file on one side,
> compress, transfer to other side, uncompress and then parse the file and
> insert records
> one-by-one in a single transaction.
>   Firebird 4 has some kind of batch interface, but I'm not sure if it can
> speed up bulk load.
>
> --
>   WBR, SD.
>
>
> ------------------------------------
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu.  Try FAQ and other links from the left-side menu
> there.
>
> Also search the knowledgebases at
> http://www.ibphoenix.com/resources/documents/
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ------------------------------------
>
> Yahoo Groups Links
>
>
>



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

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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@yahoogroups.com
    firebird-support-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/