Subject Re: [firebird-support] Which way is best...
Author Martijn Tonies
> According to my earlier postings, I would like to know which way is best.
> I have a table, containing some 4 mill. records.
> Each records has several varchars, date, numeric and integer fields.
> I have to insert around 300.000 more, which will be almost identical
> to some other 300.000 except for 1 field.
> What I do now is
> Select
> Fields I need
> from table
> where
> some condition
> Then I iterate through to dataset and insert 1 record for each record.
> How do I do that the best way ?

Another possibility would be:

insert in mytable ( columns ... )
values select columns, myother_value
from ...
where <make sure it doesn't select rows you're inserting, this is a Firebird

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Upscene Productions
Database development questions? Check the forum!