Subject | Re: what the most efficient way to do update or insert with value ? |
---|---|
Author | nathanelrick |
Post date | 2012-02-15T19:59:39Z |
thanks yes the merge to the job :)
but i m just curious to know if the merge is more speed efficient
than a simple
for select ...
do begin
If Exists(...) Update ... Else Insert .... :
END
because merge is not very "user readable" :(
but i m just curious to know if the merge is more speed efficient
than a simple
for select ...
do begin
If Exists(...) Update ... Else Insert .... :
END
because merge is not very "user readable" :(
--- In firebird-support@yahoogroups.com, Milan Babuskov <milanb@...> wrote:
>
> nathanelrick wrote:
> > i want to do something like
> >
> > update or insert into mytable(ID, amount) values (123, amount + 100);
> >
> > how to do this ?
>
> Use MERGE:
>
> http://www.firebirdsql.org/refdocs/langrefupd25-merge.html
>
> If you have an older Firebird version and still want a single SQL
> command, you can use EXECUTE BLOCK as explained in
>
> http://www.firebirdfaq.org/faq220/
>
>
> --
> Milan Babuskov
>
> ==================================
> The easiest way to import XML, CSV
> and textual files into Firebird:
> http://www.guacosoft.com/xmlwizard
> ==================================
>