Subject Re: [firebird-support] Problem in Bulk Insertion in Firebird - Please Help
Author Svein Erling Tysvaer
Hi Manish!

Firebird doesn't have any 'bulk insert' option, and I doubt EXECUTE
BLOCK is the answer you are looking for, maybe you were thinking of
EXECUTE STATEMENT (though I doubt that is any good answer for your problem)?

Why do you want bulk insert? Normal inserts can, if done properly and
not too wide records, insert about 10000 records per second. Storing the
data into a flat file, declare this file as an EXTERNAL TABLE and then
do an insert where you select from the external table is another option
that is supposed to be even faster.

Set

Manish Lal Joshi wrote:
> Hi,
> I have just joined this group.
> I am in real trouble.
> I have been developing application in C# and MsSQL 2005.
> As an embedded RDBMS was required so i swtiched to FB 2.
> I have ported tables and Stored procedures successfully oin FB 2.
> I have been using Firebrid (embedded version) 2.0.XXXXX and .net Data
> Provider 2.0.1.0.
> Till now every thing was working fine. But i am having problem with
> insertion.
> Previously i was using mssql's bulkcopy property to do bulk inserts
> but now i dont know how to do bulk inserts in FB.
> Can some body provide me the SP doing BULK insertions ?
> I have tried using EXECUTE BLOCK inside SP but it says TOKEN UNKNOWN
> 'BLOCK'.
>
> I have dont like this or i want something like this:
>
> from C# application i will be creating multiple insert statements like
>
> string statements=" INSERT INTO TABLE1 VALUES(1,1);
> INSERT INTO TABLE1 VALUES(2,2);
> INSERT INTO TABLE1 VALUES(3,3);
> INSERT INTO TABLE1 VALUES(4,4);
> INSERT INTO TABLE1 VALUES(5,5);
> INSERT INTO TABLE1 VALUES(6,6); "
>
> And i will be calling stored procedure BULKUPDATE defined as
>
> SET TERM !! ;
> CREATE PROCEDURE DUMPVALUE(datainput VARCHAR(250))
> AS
> BEGIN
> EXECUTE BLOCK AS BEGIN
> :datainput;
> END
> END
> !!
> SET TERM ; !!
>
>
> I have been using FB from last 4 days.
> Please help me with this and i will be very much grateful to you all..