Subject | Re: [firebird-support] Re: bulk insert |
---|---|
Author | Aage Johansen |
Post date | 2005-05-19T21:23:49Z |
pwidf wrote:
You could build a string like
insert into TBL (F1,F2) values (:P1,:P2)
Then stuff this into a query component, and do a 'prepare'.
Then for every record you want to insert, you set the parameters P1 and P2
to the actual values, and execute.
The 'prepare' is done once, and thus the server don't have to parse and
optimize the same insert statement for every record.
--
Aage J.
>> Using a parameterized, prepared insert statement should be fast -some stringbuilding to generate the insert statements
>
>
> maybe as fast using an "external table".
>
> mm, what do you by "parameterized, prepared insert statement"?
> in the background this is for use in an adhoc query tool, so i am doing
>This depends somewhat on which component set you are using.
You could build a string like
insert into TBL (F1,F2) values (:P1,:P2)
Then stuff this into a query component, and do a 'prepare'.
Then for every record you want to insert, you set the parameters P1 and P2
to the actual values, and execute.
The 'prepare' is done once, and thus the server don't have to parse and
optimize the same insert statement for every record.
--
Aage J.