Subject | Re: [firebird-support] Performance diff between insert...select and for select ... do? |
---|---|
Author | Kjell Rilbe |
Post date | 2015-02-16T06:20:22Z |
Mark Rotteveel mark@... [firebird-support] skrev:
I will need to do BOTH update AND insert for each external record, but I
haven't checked what merge can do yet... :-)
Kjell
>Thanks, that might be worth looking into. I suspect it won't work since
> On 13-2-2015 14:55, Kjell Rilbe kjell.rilbe@...
> [firebird-support] wrote:
> > I'm writing a utility that will need to do two things for each record in
> > an external table and for this purpose I use a for select ... do
> > construct in an execute block. I do it this way because external tables
> > can't be indexed and I will scan the entire external table anyway.
> >
> > The two operations are:
> > 1. Update one existing record in the target table.
> > 2. Insert new record in the same target table.
>
> Maybe you can use MERGE, it uses a source, a target and can
> conditionally insert, update (and delete) record? I assume your target
> table isn't external and is indexed.
>
I will need to do BOTH update AND insert for each external record, but I
haven't checked what merge can do yet... :-)
Kjell
> --
> ------------------------------
> Kjell Rilbe
> DataDIA AB
> E-post: kjell.rilbe@...
> Telefon: 08-761 06 55
> Mobil: 0733-44 24 64